Remove getRoster() helper method

This commit is contained in:
Philipp Hörist 2019-05-18 20:51:01 +02:00
parent 2e50ac5205
commit 02915163dc
3 changed files with 4 additions and 7 deletions

View File

@ -1638,9 +1638,6 @@ class Connection(CommonConnection, ConnectionHandlers):
self.connection = con
nbxmpp.features.getRegInfo(con, self._hostname)
def getRoster(self):
return self.get_module('Roster')
def send_agent_status(self, agent, ptype):
if not app.account_is_connected(self.name):
return

View File

@ -33,7 +33,7 @@ class Gateway(BaseModule):
self._con.connection.SendAndCallForResponse(
iq, self._on_unsubscribe_result)
self._con.getRoster().del_item(agent)
self._con.get_module('Roster').del_item(agent)
def _on_unsubscribe_result(self, stanza):
if not nbxmpp.isResultNode(stanza):

View File

@ -305,15 +305,15 @@ class Presence(BaseModule):
if not app.account_is_connected(self._account):
return
if remove_auth:
self._con.getRoster().del_item(jid)
self._con.get_module('Roster').del_item(jid)
jid_list = app.config.get_per('contacts')
for j in jid_list:
if j.startswith(jid):
app.config.del_per('contacts', j)
else:
self._log.info('Unsubscribe from %s', jid)
self._con.getRoster().unsubscribe(jid)
self._con.getRoster().set_item(jid)
self._con.get_module('Roster').unsubscribe(jid)
self._con.get_module('Roster').set_item(jid)
def subscribe(self, jid, msg=None, name='', groups=None, auto_auth=False):
if not app.account_is_connected(self._account):