Skip to content

Commit

Permalink
fixes: after rm -rf server/data/* and one reload of the interface, a …
Browse files Browse the repository at this point in the history
…javascript error appears
  • Loading branch information
kerphi committed Jan 9, 2013
1 parent 28159cf commit a3596b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions client/jquery.phpfreechat.core.js
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion server/routes/channels.php
Expand Up @@ -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
Expand Down

0 comments on commit a3596b7

Please sign in to comment.