Code Duplication    Length = 11-11 lines in 2 locations

main/inc/lib/CourseChatUtils.php 2 locations

@@ 125-135 (lines=11) @@
122
        $timeNow = date('d/m/y H:i:s');
123
        $basename_chat = 'messages-' . $date_now;
124
125
        if ($this->groupId && !$friendId) {
126
            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
127
        } elseif ($this->sessionId && !$friendId) {
128
            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
129
        } elseif ($friendId) {
130
            if ($this->userId < $friendId) {
131
                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
132
            } else {
133
                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
134
            }
135
        }
136
137
        $message = self::prepareMessage($message);
138
@@ 1622-1632 (lines=11) @@
1619
1620
        $basename_chat = 'messages-' . $date_now;
1621
1622
        if ($this->groupId && !$friendId) {
1623
            $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId;
1624
        } else if ($this->sessionId && !$friendId) {
1625
            $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId;
1626
        } elseif ($friendId) {
1627
            if ($this->userId < $friendId) {
1628
                $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId;
1629
            } else {
1630
                $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId;
1631
            }
1632
        }
1633
1634
        if ($reset && $isMaster) {
1635