Browse Source

More proper check to see if the user is actually logued in a MUC

pull/551/head
Timothée Jaussoin 8 years ago
parent
commit
950f525725
  1. 1
      app/models/conference/Conference.php
  2. 5
      app/models/presence/Presence.php
  3. 10
      app/widgets/Rooms/Rooms.php
  4. 2
      composer.json
  5. 10
      composer.lock

1
app/models/conference/Conference.php

@ -24,7 +24,6 @@ class Conference extends Model
'name' => ['type' => 'string','size' => 128,'mandatory' => true],
'nick' => ['type' => 'string','size' => 128],
'autojoin' => ['type' => 'bool'],
'status' => ['type' => 'bool'],
];
public function setAvatar($vcard, $conference)

5
app/models/presence/Presence.php

@ -116,10 +116,11 @@ class Presence extends Model
if(!isset($c->item)) break;
$this->muc = true;
if($c->item->attributes()->jid)
if($c->item->attributes()->jid) {
$this->mucjid = cleanJid((string)$c->item->attributes()->jid);
else
} else {
$this->mucjid = (string)$stanza->attributes()->from;
}
if($c->item->attributes()->role) {
$this->mucrole = (string)$c->item->attributes()->role;

10
app/widgets/Rooms/Rooms.php

@ -381,15 +381,7 @@ class Rooms extends \Movim\Widget\Base
}
$pd = new \Modl\PresenceDAO;
if($resource == false) {
$session = Session::start();
$resource = $session->get('username');
}
$presence = $pd->getPresence($room, $resource);
return ($presence != null);
return ($pd->getMyPresenceRoom($room) != null);
}
/**

2
composer.json

@ -16,7 +16,7 @@
"movim/modl": "dev-master#03c6f6e0c83b494ba33df318a724caf779cd37a8",
"movim/sasl2": "dev-master",
"movim/moxl": "dev-master#ac840176dbbc230d6e7d260094acc9b2197ea9bd",
"movim/moxl": "dev-master#5eaf633fe9e23e7103a121f8d141236df9368ad2",
"embed/embed": "dev-master",
"heyupdate/emoji": "dev-twemoji2#99dda1bed08472046cac1498221f08684ad83d55",

10
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "554dea4d1e3ee6a2718a222e248e8ae2",
"content-hash": "b2cd4b76688eecd94ea9a6d2fffd0ed2",
"packages": [
{
"name": "cboden/ratchet",
@ -766,12 +766,12 @@
"source": {
"type": "git",
"url": "https://github.com/movim/moxl.git",
"reference": "ac840176dbbc230d6e7d260094acc9b2197ea9bd"
"reference": "5eaf633fe9e23e7103a121f8d141236df9368ad2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/movim/moxl/zipball/ac840176dbbc230d6e7d260094acc9b2197ea9bd",
"reference": "ac840176dbbc230d6e7d260094acc9b2197ea9bd",
"url": "https://api.github.com/repos/movim/moxl/zipball/5eaf633fe9e23e7103a121f8d141236df9368ad2",
"reference": "5eaf633fe9e23e7103a121f8d141236df9368ad2",
"shasum": ""
},
"require": {
@ -806,7 +806,7 @@
"php",
"xmpp"
],
"time": "2017-12-03 19:04:16"
"time": "2017-12-10 22:27:10"
},
{
"name": "movim/sasl2",

Loading…
Cancel
Save