Commit 5e81fe27 authored by Madhur Garg's avatar Madhur Garg

Removed error messages on startup.

parent 81d9c267
......@@ -67,7 +67,8 @@ async def query(tab, remote_jid, action, amount, top, start=None, end=None, befo
try:
iq = await tab.core.xmpp.plugin['xep_0030'].get_info(jid=remote_jid)
except (IqError, IqTimeout):
return tab.core.information('Failed to retrieve messages', 'Error')
if action is 'scroll':
return tab.core.information('%s : Failed to retrieve messages' % remote_jid, 'Error')
if 'urn:xmpp:mam:2' not in iq['disco_info'].get_features() and action is 'scroll':
return tab.core.information("%s doesn't support MAM." % remote_jid, "Info")
if top:
......@@ -81,7 +82,7 @@ async def query(tab, remote_jid, action, amount, top, start=None, end=None, befo
iterator=True, reverse=top, end=end, rsm={'max':amount})
except (IqError, IqTimeout):
if action is 'scroll':
return tab.core.information('Failed to retrieve messages', 'Error')
return tab.core.information('%s : Failed to retrieve messages' % remote_jid, 'Error')
else:
try:
if before is not None:
......@@ -92,20 +93,20 @@ async def query(tab, remote_jid, action, amount, top, start=None, end=None, befo
iterator=True, reverse=top, end=end, rsm={'max':amount})
except (IqError, IqTimeout):
if action is 'scroll':
return tab.core.information('Failed to retrieve messages', 'Error')
return tab.core.information('%s : Failed to retrieve messages' % remote_jid, 'Error')
else:
if 'conference' in list(iq['disco_info']['identities'])[0]:
try:
results = tab.core.xmpp['xep_0313'].retrieve(jid=remote_jid,
iterator=True, reverse=top, start=start, end=end)
except (IqError, IqTimeout):
return tab.core.information('Failed to retrieve messages', 'Error')
return tab.core.information('%s : Failed to retrieve messages' % remote_jid, 'Error')
else:
try:
results = tab.core.xmpp['xep_0313'].retrieve(with_jid=remote_jid,
iterator=True, reverse=top, start=start, end=end)
except (IqError, IqTimeout):
return tab.core.information('Failed to retrieve messages', 'Error')
return tab.core.information('%s : Failed to retrieve messages' % remote_jid, 'Error')
msg_count = 0
msgs = []
async for rsm in results:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment