Browse Source

Don't request AdHoc commands on the Account page anymore, they are in the drawer

feature/templater
Timothée Jaussoin 3 months ago
parent
commit
4120b7949d
  1. 1
      app/PresenceBufferSaver.php
  2. 5
      app/Widgets/AdHoc/AdHoc.php
  3. 12
      app/Widgets/AdHoc/adhoc.js

1
app/PresenceBufferSaver.php

@ -114,6 +114,7 @@ class PresenceBufferSaver
Scheduler::getInstance()->append('avatar_' . $jid . '_' . $avatarhash, function () use ($jid, $avatarhash) {
// Last check before firing the request, the avatar might have been received in the meantime
$contact = Contact::where('avatarhash', $avatarhash)->where('id', $jid)->first();
if (!$contact || $contact->avatartype == null) {
$r = new Get;
$r->setAvatarhash($avatarhash)

5
app/Widgets/AdHoc/AdHoc.php

@ -52,11 +52,6 @@ class AdHoc extends \Movim\Widget\Base
$view = $this->tpl();
$view->assign('jid', $packet->from);
// Refresh the AdHoc list in any cases
if ((string)$command->attributes()->status === 'completed') {
$this->rpc('AdHoc.init');
}
if (isset($command->note)) {
$view->assign('note', $command->note);
Dialog::fill($view->draw('_adhoc_note'));

12
app/Widgets/AdHoc/adhoc.js

@ -1,12 +1,4 @@
var AdHoc = {
init: function () {
var parts = MovimUtils.urlParts();
if (parts.page === "contact") {
AdHoc_ajaxGet(parts.params[0]);
} else {
AdHoc_ajaxGet();
}
},
refresh: function () {
var items = document.querySelectorAll('.adhoc_widget .actions li:not(.subheader)');
var i = 0;
@ -54,7 +46,3 @@ var AdHoc = {
}
}
}
MovimWebsocket.attach(function () {
AdHoc.init();
});
Loading…
Cancel
Save