Browse Source

- Return less data to the roster to boost the execution

- Add a timeOut for the login
- Fix a warning in the Presence template
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
040b0695f8
  1. 11
      app/models/contact/Contact.php
  2. 3
      app/widgets/Login/login.js
  3. 4
      app/widgets/Presence/_presence_list.tpl
  4. 1
      app/widgets/Profile/Profile.php
  5. 5
      app/widgets/Roster/Roster.php
  6. 6
      linker.php

11
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 {

3
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

4
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}</textarea>
onkeyup="movim_textarea_autoheight(this);">{if="isset($p)"}{$p->status}{/if}</textarea>
<a onclick="{$callchat} movim_toggle_class('#logoutlist', 'show');" class="online"><span class="bubble"></span>{$txt[1]}</a>
<a onclick="{$callaway} movim_toggle_class('#logoutlist', 'show');" class="away"><span class="bubble"></span>{$txt[2]}</a>
<a onclick="{$calldnd} movim_toggle_class('#logoutlist', 'show');" class="dnd"><span class="bubble"></span>{$txt[3]}</a>

1
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)

5
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;
}

6
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);
}
});

Loading…
Cancel
Save