Permalink
Browse files

reverted some unfinished changes in chatd - enter message

  • Loading branch information...
1 parent 379a42c commit 2ac0d13b6f99564e07aff7c5fd7455535ce10134 skodak committed Feb 4, 2005
Showing with 13 additions and 11 deletions.
  1. +2 −2 mod/chat/chatd.php
  2. +11 −9 mod/chat/lib.php
View
@@ -531,7 +531,7 @@ function promote_final($sessionid, $groupid, $customdata) {
$this->dismiss_half($sessionid, false);
$this->write_data($this->conn_sets[$sessionid][CHAT_CONNECTION_CHANNEL], $CHAT_HTMLHEAD_JS);
$this->trace('Connection accepted: '.$this->conn_sets[$sessionid][CHAT_CONNECTION_CHANNEL].', SID: '.$sessionid.' UID: '.$chatuser->userid.' GID: '.intval($groupid), E_USER_WARNING);
-/*
+
// Finally, broadcast the "entered the chat" message
$msg = &New stdClass;
@@ -544,7 +544,7 @@ function promote_final($sessionid, $groupid, $customdata) {
insert_record('chat_messages', $msg);
$this->message_broadcast($msg, $this->sets_info[$sessionid]['user']);
-*/
+
return true;
}
View
@@ -389,15 +389,17 @@ function chat_login_user($chatid, $version, $groupid, $course) {
return false;
}
- $message->chatid = $chatuser->chatid;
- $message->userid = $chatuser->userid;
- $message->groupid = $groupid;
- $message->message = 'enter';
- $message->system = 1;
- $message->timestamp = time();
-
- if (!insert_record('chat_messages', $message)) {
- error('Could not insert a chat message!');
+ if ($version == 'header_js') {
+ $message->chatid = $chatuser->chatid;
+ $message->userid = $chatuser->userid;
+ $message->groupid = $groupid;
+ $message->message = 'enter';
+ $message->system = 1;
+ $message->timestamp = time();
+
+ if (!insert_record('chat_messages', $message)) {
+ error('Could not insert a chat message!');
+ }
}
}

0 comments on commit 2ac0d13

Please sign in to comment.