Small portion of method refactoring
This commit is contained in:
parent
3fe45b5a56
commit
a8cb838769
18
src/disco.py
18
src/disco.py
|
@ -1973,7 +1973,7 @@ class DiscussionGroupsBrowser(AgentBrowser):
|
||||||
self.subscribe_button = None
|
self.subscribe_button = None
|
||||||
self.unsubscribe_button = None
|
self.unsubscribe_button = None
|
||||||
|
|
||||||
gajim.connections[account].send_pb_subscription_query(jid, self._subscriptionsCB)
|
gajim.connections[account].send_pb_subscription_query(jid, self._on_xmpp_subscriptions)
|
||||||
|
|
||||||
def _create_treemodel(self):
|
def _create_treemodel(self):
|
||||||
"""
|
"""
|
||||||
|
@ -2141,7 +2141,7 @@ class DiscussionGroupsBrowser(AgentBrowser):
|
||||||
|
|
||||||
groupnode = model.get_value(iter_, 1) # 1 = groupnode
|
groupnode = model.get_value(iter_, 1) # 1 = groupnode
|
||||||
|
|
||||||
gajim.connections[self.account].send_pb_subscribe(self.jid, groupnode, self._subscribeCB, groupnode)
|
gajim.connections[self.account].send_pb_subscribe(self.jid, groupnode, self._on_xmpp_subscribe, groupnode)
|
||||||
|
|
||||||
def on_unsubscribe_button_clicked(self, widget):
|
def on_unsubscribe_button_clicked(self, widget):
|
||||||
"""
|
"""
|
||||||
|
@ -2152,9 +2152,9 @@ class DiscussionGroupsBrowser(AgentBrowser):
|
||||||
|
|
||||||
groupnode = model.get_value(iter_, 1) # 1 = groupnode
|
groupnode = model.get_value(iter_, 1) # 1 = groupnode
|
||||||
|
|
||||||
gajim.connections[self.account].send_pb_unsubscribe(self.jid, groupnode, self._unsubscribeCB, groupnode)
|
gajim.connections[self.account].send_pb_unsubscribe(self.jid, groupnode, self._on_xmpp_unsubscribe, groupnode)
|
||||||
|
|
||||||
def _subscriptionsCB(self, conn, request):
|
def _on_xmpp_subscriptions(self, conn, request):
|
||||||
"""
|
"""
|
||||||
We got the subscribed groups list stanza. Now, if we already have items
|
We got the subscribed groups list stanza. Now, if we already have items
|
||||||
on the list, we should actualize them
|
on the list, we should actualize them
|
||||||
|
@ -2177,15 +2177,15 @@ class DiscussionGroupsBrowser(AgentBrowser):
|
||||||
# 3 = insensitive checkbox for subscribed
|
# 3 = insensitive checkbox for subscribed
|
||||||
# 4 = subscribed?
|
# 4 = subscribed?
|
||||||
groupnode = row[1]
|
groupnode = row[1]
|
||||||
row[3]=False
|
row[3] = False
|
||||||
row[4]=groupnode in groups
|
row[4] = groupnode in groups
|
||||||
|
|
||||||
# we now know subscriptions, update button states
|
# we now know subscriptions, update button states
|
||||||
self.update_actions()
|
self.update_actions()
|
||||||
|
|
||||||
raise xmpp.NodeProcessed
|
raise xmpp.NodeProcessed
|
||||||
|
|
||||||
def _subscribeCB(self, conn, request, groupnode):
|
def _on_xmpp_subscribe(self, conn, request, groupnode):
|
||||||
"""
|
"""
|
||||||
We have just subscribed to a node. Update UI
|
We have just subscribed to a node. Update UI
|
||||||
"""
|
"""
|
||||||
|
@ -2194,14 +2194,14 @@ class DiscussionGroupsBrowser(AgentBrowser):
|
||||||
model = self.window.services_treeview.get_model()
|
model = self.window.services_treeview.get_model()
|
||||||
for row in model:
|
for row in model:
|
||||||
if row[1] == groupnode: # 1 = groupnode
|
if row[1] == groupnode: # 1 = groupnode
|
||||||
row[4]=True
|
row[4] = True
|
||||||
break
|
break
|
||||||
|
|
||||||
self.update_actions()
|
self.update_actions()
|
||||||
|
|
||||||
raise xmpp.NodeProcessed
|
raise xmpp.NodeProcessed
|
||||||
|
|
||||||
def _unsubscribeCB(self, conn, request, groupnode):
|
def _on_xmpp_unsubscribe(self, conn, request, groupnode):
|
||||||
"""
|
"""
|
||||||
We have just unsubscribed from a node. Update UI
|
We have just unsubscribed from a node. Update UI
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue