From d40026cabdab2a155ffed4b346030721421234bc Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 7 Feb 2006 12:56:20 +0000 Subject: [PATCH] an admin can now modify the ban list. for #530 --- src/config.py | 10 +++++++--- src/groupchat_control.py | 10 +++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/config.py b/src/config.py index 5a1f3f120..f1f667bc1 100644 --- a/src/config.py +++ b/src/config.py @@ -1654,7 +1654,11 @@ class DataFormWindow: self.xml = gtk.glade.XML(GTKGUI_GLADE, 'data_form_window', APP) self.window = self.xml.get_widget('data_form_window') self.config_table = self.xml.get_widget('config_table') - self.fill_table() + if config: + self.fill_table() + else: + self.config_table.set_no_show_all(True) + self.config_table.hide() self.xml.signal_autoconnect(self) self.window.show_all() @@ -1877,8 +1881,8 @@ class ServiceRegistrationWindow(DataFormWindow): class GroupchatConfigWindow(DataFormWindow): '''GroupchatConfigWindow class''' - def __init__(self, account, room_jid, config): - DataFormWindow.__init__(self, account, config) + def __init__(self, account, room_jid, config = None): + DataFormWindow.__init__(self, account, config = None) self.room_jid = room_jid self.remove_button = {} self.affiliation_treeview = {} diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 4100a3696..7dd4efca6 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -31,6 +31,7 @@ import gtkgui_helpers import message_control import tooltips import dialogs +import config import vcard import cell_renderer_image import history_window @@ -1087,7 +1088,14 @@ class GroupchatControl(ChatControlBase): self.show_change_nick_input_dialog(title, prompt, self.nick) def _on_configure_room_menuitem_activate(self, widget): - gajim.connections[self.account].request_gc_config(self.room_jid) + c = gajim.contacts.get_gc_contact(self.account, self.room_jid, self.nick) + if c.affiliation == 'owner': + gajim.connections[self.account].request_gc_config(self.room_jid) + elif c.affiliation == 'admin': + if not gajim.interface.instances[self.account]['gc_config'].has_key( + self.room_jid): + gajim.interface.instances[self.account]['gc_config'][self.room_jid]\ + = config.GroupchatConfigWindow(self.account, self.room_jid) def _on_bookmark_room_menuitem_activate(self, widget): bm = {