Code Duplication    Length = 11-11 lines in 2 locations

main/inc/lib/CourseChatUtils.php 2 locations

@@ 118-128 (lines=11) @@
115
        $timeNow = date('d/m/y H:i:s');
116
        $basename_chat = 'messages-' . $date_now;
117
118
        if ($this->groupId && !$friendId) {
119
            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
120
        } elseif ($this->sessionId && !$friendId) {
121
            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
122
        } elseif ($friendId) {
123
            if ($this->userId < $friendId) {
124
                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
125
            } else {
126
                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
127
            }
128
        }
129
130
        $message = self::prepareMessage($message);
131
@@ 1615-1625 (lines=11) @@
1612
1613
        $basename_chat = 'messages-' . $date_now;
1614
1615
        if ($this->groupId && !$friendId) {
1616
            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
1617
        } else if ($this->sessionId && !$friendId) {
1618
            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
1619
        } elseif ($friendId) {
1620
            if ($this->userId < $friendId) {
1621
                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
1622
            } else {
1623
                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
1624
            }
1625
        }
1626
1627
        if ($reset && $isMaster) {
1628