Code Duplication    Length = 11-11 lines in 2 locations

main/inc/lib/CourseChatUtils.php 2 locations

@@ 136-146 (lines=11) @@
133
        $timeNow = date('d/m/y H:i:s');
134
        $basename_chat = 'messages-' . $date_now;
135
136
        if ($this->groupId && !$friendId) {
137
            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
138
        } elseif ($this->sessionId && !$friendId) {
139
            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
140
        } elseif ($friendId) {
141
            if ($this->userId < $friendId) {
142
                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
143
            } else {
144
                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
145
            }
146
        }
147
148
        $message = self::prepareMessage($message);
149
@@ 1595-1605 (lines=11) @@
1592
1593
        $basename_chat = 'messages-' . $date_now;
1594
1595
        if ($this->groupId && !$friendId) {
1596
            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
1597
        } else if ($this->sessionId && !$friendId) {
1598
            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
1599
        } elseif ($friendId) {
1600
            if ($this->userId < $friendId) {
1601
                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
1602
            } else {
1603
                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
1604
            }
1605
        }
1606
1607
        if ($reset && $isMaster) {
1608