Permalink
Browse files

fixes: after rm -rf server/data/* and one reload of the interface, a …

…javascript error appears
  • Loading branch information...
kerphi committed Jan 9, 2013
1 parent 28159cf commit a3596b7aaa69536b60e66934d26428327aa11ba7
Showing with 8 additions and 4 deletions.
  1. +4 −3 client/jquery.phpfreechat.core.js
  2. +4 −1 server/routes/channels.php
@@ -74,10 +74,11 @@ var phpFreeChat = (function (pfc, $, window, undefined) {
// store userdata in the cache
// refresh the interface
pfc.clearUserList();
- $.each(cinfo.users, function (uid) {
+ $.each(cinfo.users, function (uid, udata) {
pfc.channels[cid].users.push(uid);
- pfc.users[uid] = cinfo.users[uid];
- pfc.appendUser(cinfo.users[uid]);
+
+ pfc.users[uid] = udata;
+ pfc.appendUser(udata);
});
// display a join message for him
@@ -62,7 +62,10 @@
if (!Container_users::joinChannel($uid, $cid)) {
$res->status(200); // User already joined the channel
$res['Content-Type'] = 'application/json; charset=utf-8';
- $res->body(json_encode(Container_channels::getChannelUsers($cid, true)));
+ $res->body(json_encode(array(
+ 'users' => Container_channels::getChannelUsers($cid, true),
+ 'op' => Container_channels_op::getOpList($cid),
+ )));
return;
} else {
// post a join message

0 comments on commit a3596b7

Please sign in to comment.