Code Duplication    Length = 11-11 lines in 2 locations

main/inc/lib/CourseChatUtils.php 2 locations

@@ 138-148 (lines=11) @@
135
        $timeNow = date('d/m/y H:i:s');
136
        $basename_chat = 'messages-' . $date_now;
137
138
        if ($this->groupId && !$friendId) {
139
            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
140
        } elseif ($this->sessionId && !$friendId) {
141
            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
142
        } elseif ($friendId) {
143
            if ($this->userId < $friendId) {
144
                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
145
            } else {
146
                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
147
            }
148
        }
149
150
        $message = self::prepareMessage($message);
151
@@ 1635-1645 (lines=11) @@
1632
1633
        $basename_chat = 'messages-' . $date_now;
1634
1635
        if ($this->groupId && !$friendId) {
1636
            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
1637
        } else if ($this->sessionId && !$friendId) {
1638
            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
1639
        } elseif ($friendId) {
1640
            if ($this->userId < $friendId) {
1641
                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
1642
            } else {
1643
                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
1644
            }
1645
        }
1646
1647
        if ($reset && $isMaster) {
1648