don't try to configure a room for which we are not admin. See #7422

This commit is contained in:
Yann Leboulanger 2013-08-13 13:02:31 +02:00
parent a7a0a108b6
commit 8562d66d53
1 changed files with 15 additions and 2 deletions

View File

@ -1567,8 +1567,21 @@ class GroupchatControl(ChatControlBase):
gajim.automatic_rooms[self.account][self.room_jid]['invities']: gajim.automatic_rooms[self.account][self.room_jid]['invities']:
if self.room_jid not in gajim.interface.instances[ if self.room_jid not in gajim.interface.instances[
self.account]['gc_config']: self.account]['gc_config']:
if obj.role == 'owner':
# We need to configure the room if it's a new one.
# We cannot know it's a new one. Status 201 is not
# sent by all servers.
gajim.connections[self.account].request_gc_config( gajim.connections[self.account].request_gc_config(
self.room_jid) self.room_jid)
elif 'continue_tag' not in gajim.automatic_rooms[
self.account][self.room_jid]:
# We just need to invite contacts
for jid in gajim.automatic_rooms[self.account][
self.room_jid]['invities']:
obj.conn.send_invite(self.room_jid, jid)
self.print_conversation(_('%(jid)s has been '
'invited in this room') % {'jid': jid},
graphics=False)
if '100' in obj.status_code: if '100' in obj.status_code:
# Can be a message (see handle_event_gc_config_change in # Can be a message (see handle_event_gc_config_change in
# gajim.py) # gajim.py)