Dont want previous messages showing

62 views
Skip to first unread message

dean wrigglesworth

unread,
Sep 22, 2016, 5:19:01 PM9/22/16
to AJAX-chat
Hi
I've been trying to stop previous messages showing so far i've got the following set but its still showing old messages

// Defines if messages are shown which have been sent before the user entered the channel:
$config['requestMessagesPriorChannelEnter'] = false;
// Defines an array of channelIDs (e.g. array(0, 1)) for which the previous setting is always true (will be ignored if set to null):
$config['requestMessagesPriorChannelEnterList'] = null;
// Max time difference in hours for messages to display on each request:
$config['requestMessagesTimeDiff'] = 0;
// Max number of messages to display on each request:
$config['requestMessagesLimit'] = 0;

am i missing something else??

Many thanks for your help 
Dean

Cuore di angelo

unread,
Sep 23, 2016, 11:51:02 AM9/23/16
to AJAX-chat
to get what you look for values ​​should be set in this way:

// Defines if messages are shown which have been sent before the user entered the channel:
$config['requestMessagesPriorChannelEnter'] = false;
// Defines an array of channelIDs (e.g. array(0, 1)) for which the previous setting is always true (will be ignored if set to null):
$config['requestMessagesPriorChannelEnterList'] = null;
// Max time difference in hours for messages to display on each request:
$config['requestMessagesTimeDiff'] = 24;
// Max number of messages to display on each request:
$config['requestMessagesLimit'] = 10;

dean wrigglesworth

unread,
Sep 24, 2016, 4:14:26 AM9/24/16
to AJAX-chat
Hi Many thanks for your reply its still showing messages we run a support group and it would be wrong for other people who enter to be able to see what has been put anyone else have any ideas???

Many thanks
Dean

Banjo Fox

unread,
Sep 25, 2016, 9:11:23 PM9/25/16
to AJAX-chat
I am able to confirm that setting:

$config['requestMessagesPriorChannelEnter'] = false;

Does not appear to have any affect. I tried to fiddle with some other combinations, but again was unable to prevent previous messages from showing.
The best I could do was limit the messages to 1 (setting the requestMessagesLimit to 0 breaks my chat).

This is the function that controls whether or not previous messages are shown (lib/class/AJAXChat.php).

function getMessageCondition() {
        $condition =    'id > '.$this->db->makeSafe($this->getRequestVar('lastID')).'
                                        AND (
                                                channel = '.$this->db->makeSafe($this->getChannel()).'
                                                OR
                                                channel = '.$this->db->makeSafe($this->getPrivateMessageID()).'
                                        )
                                        AND
                                        ';
        if($this->getConfig('requestMessagesPriorChannelEnter') ||
                ($this->getConfig('requestMessagesPriorChannelEnterList') && in_array($this->getChannel(), $this->getConfig('requestMessagesPriorChannelEnterList')))) {
                $condition .= 'NOW() < DATE_ADD(dateTime, interval '.$this->getConfig('requestMessagesTimeDiff').' HOUR)';
        } else {
                $condition .= 'dateTime >= FROM_UNIXTIME(' . $this->getChannelEnterTimeStamp() . ')';
        }
        return $condition;
}

ingridtr...@gmail.com

unread,
Sep 29, 2016, 2:16:20 PM9/29/16
to ajax...@googlegroups.com
if i remember correctly this chat offers the possibility to send private messages. You could instruct users to open a private channel?
**edit** Had to install a copy of the latetst standalone 0.88 to check if i wasn't talking nonsense. :)
A user can click the name in the right column "Open private channel". Why isn't that an option?
**edit2** 
Setting $config['requestMessagesPriorChannelEnter'] = false; in config.php works fine here.
Reply all
Reply to author
Forward
0 new messages