| ... |
... |
@@ -59,26 +59,26 @@ class MUC: |
|
59
|
59
|
presence = self._con.get_module('Presence').get_presence(
|
|
60
|
60
|
*args, **kwargs)
|
|
61
|
61
|
|
|
|
62
|
+ muc_x = presence.setTag(nbxmpp.NS_MUC + ' x')
|
|
62
|
63
|
if room_jid is not None:
|
|
63
|
|
- self._add_history_query(presence, room_jid, rejoin)
|
|
|
64
|
+ self._add_history_query(muc_x, room_jid, rejoin)
|
|
64
|
65
|
|
|
65
|
66
|
if password is not None:
|
|
66
|
|
- presence.setTagData('password', password)
|
|
|
67
|
+ muc_x.setTagData('password', password)
|
|
67
|
68
|
|
|
68
|
69
|
log.debug('Send MUC join presence:\n%s', presence)
|
|
69
|
70
|
|
|
70
|
71
|
self._con.connection.send(presence)
|
|
71
|
72
|
|
|
72
|
|
- def _add_history_query(self, presence, room_jid, rejoin):
|
|
|
73
|
+ def _add_history_query(self, muc_x, room_jid, rejoin):
|
|
73
|
74
|
last_date = app.logger.get_room_last_message_time(
|
|
74
|
75
|
self._account, room_jid)
|
|
75
|
76
|
if not last_date:
|
|
76
|
77
|
last_date = 0
|
|
77
|
78
|
|
|
78
|
|
- history = presence.setTag(nbxmpp.NS_MUC + ' x')
|
|
79
|
79
|
if muc_caps_cache.has_mam(room_jid):
|
|
80
|
80
|
# The room is MAM capable dont get MUC History
|
|
81
|
|
- history.setTag('history', {'maxchars': '0'})
|
|
|
81
|
+ muc_x.setTag('history', {'maxchars': '0'})
|
|
82
|
82
|
else:
|
|
83
|
83
|
# Request MUC History (not MAM)
|
|
84
|
84
|
tags = {}
|
| ... |
... |
@@ -100,7 +100,7 @@ class MUC: |
|
100
|
100
|
if nb >= 0:
|
|
101
|
101
|
tags['maxstanzas'] = nb
|
|
102
|
102
|
if tags:
|
|
103
|
|
- history.setTag('history', tags)
|
|
|
103
|
+ muc_x.setTag('history', tags)
|
|
104
|
104
|
|
|
105
|
105
|
def set_subject(self, room_jid, subject):
|
|
106
|
106
|
if not app.account_is_connected(self._account):
|