diff --git a/app/models/contact/Contact.php b/app/models/contact/Contact.php index 914e58bad..ab04ae7dc 100755 --- a/app/models/contact/Contact.php +++ b/app/models/contact/Contact.php @@ -392,6 +392,17 @@ class Contact extends Model { return $marital[$this->marital]; } } + + function toRoster() { + return array( + 'jid' => $this->jid, + 'rostername' => $this->rostername, + 'groupname' => $this->groupname, + 'status' => $this->status, + 'ressource' => $this->ressource, + 'value' => $this->value + ); + } } class RosterContact extends Contact { diff --git a/app/widgets/Login/login.js b/app/widgets/Login/login.js index c2dfa16fc..70ff55ddc 100755 --- a/app/widgets/Login/login.js +++ b/app/widgets/Login/login.js @@ -86,6 +86,9 @@ MovimWebsocket.attach(function() localStorage.username = document.querySelector('#login').value; rememberSession(localStorage.username); + + // A fallback security + setTimeout("MovimWebsocket.unregister()", 15000); }; // We hide the Websocket error diff --git a/app/widgets/Presence/_presence_list.tpl b/app/widgets/Presence/_presence_list.tpl index 2de4bb259..45f7140da 100755 --- a/app/widgets/Presence/_presence_list.tpl +++ b/app/widgets/Presence/_presence_list.tpl @@ -31,8 +31,8 @@ spellcheck="false" placeholder="{$c->__('status.here')}" onload="movim_textarea_autoheight(this);" - onkeyup="movim_textarea_autoheight(this);">{$p->status} - + onkeyup="movim_textarea_autoheight(this);">{if="isset($p)"}{$p->status}{/if} + {$txt[1]} {$txt[2]} {$txt[3]} diff --git a/app/widgets/Profile/Profile.php b/app/widgets/Profile/Profile.php index 6189235a2..611bc220d 100755 --- a/app/widgets/Profile/Profile.php +++ b/app/widgets/Profile/Profile.php @@ -32,7 +32,6 @@ class Profile extends WidgetCommon $this->addcss('profile.css'); $this->addjs('profile.js'); $this->registerEvent('myvcard', 'onMyVcardReceived'); - $this->registerEvent('mypresence', 'onMyPresence'); } function onMyVcardReceived($vcard = false) diff --git a/app/widgets/Roster/Roster.php b/app/widgets/Roster/Roster.php index 971579f9d..245212a2e 100644 --- a/app/widgets/Roster/Roster.php +++ b/app/widgets/Roster/Roster.php @@ -38,7 +38,6 @@ class Roster extends WidgetBase function display() { - } function onDelete($packet) @@ -57,7 +56,7 @@ class Roster extends WidgetBase if($c->groupname == '') $c->groupname = $this->__('roster.ungrouped'); - $ac = $c->toArray(); + $ac = $c->toRoster(); $this->prepareContact($ac, $c, $this->getCaps()); $c = $ac; } @@ -134,7 +133,7 @@ class Roster extends WidgetBase if($c->groupname == '') $c->groupname = $this->__('roster.ungrouped'); - $ac = $c->toArray(); + $ac = $c->toRoster(); $this->prepareContact($ac, $c, $capsarr); $c = $ac; } diff --git a/linker.php b/linker.php index d5e4ceeb0..48d2a0b6a 100755 --- a/linker.php +++ b/linker.php @@ -94,12 +94,12 @@ React\Promise\all([$connector('ws://127.0.0.1:8080'), $connector($config->websoc $obj = new \StdClass; $obj->func = 'message'; $obj->body = \RPC::commit(); - $out = json_encode($obj->body); - $logger->notice("XMPP : Send to LOOP {$out}"); \RPC::clear(); if(!empty($obj->body)) { - $conn1->send(json_encode($obj)); + $out = json_encode($obj->body); + $logger->notice("XMPP : Send to LOOP {$out}"); + $conn1->send($out); } });