Only try for buddy icon 3 times
This commit is contained in:
parent
46a6122d26
commit
a0f7a4abc6
@ -470,6 +470,7 @@ class GroupChat(Chat):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._act_name = "Chat"
|
self._act_name = "Chat"
|
||||||
self._chats = {}
|
self._chats = {}
|
||||||
|
self._buddy_icon_tries = 0
|
||||||
|
|
||||||
Chat.__init__(self, self)
|
Chat.__init__(self, self)
|
||||||
|
|
||||||
@ -606,9 +607,12 @@ class GroupChat(Chat):
|
|||||||
print "Buddy icon for '%s' is size %d" % (buddy.get_nick_name(), len(icon))
|
print "Buddy icon for '%s' is size %d" % (buddy.get_nick_name(), len(icon))
|
||||||
buddy.set_icon(icon)
|
buddy.set_icon(icon)
|
||||||
|
|
||||||
if result_status == network.RESULT_FAILED or not icon:
|
if (result_status == network.RESULT_FAILED or not icon) and self._buddy_icon_tries < 3:
|
||||||
# What the heck, try again!
|
self._buddy_icon_tries = self._buddy_icon_tries + 1
|
||||||
|
print "Failed to retrieve buddy icon for '%s' on try %d of %d" % (buddy.get_nick_name(), \
|
||||||
|
self._buddy_icon_tries, 3)
|
||||||
gobject.timeout_add(1000, self._request_buddy_icon, buddy)
|
gobject.timeout_add(1000, self._request_buddy_icon, buddy)
|
||||||
|
return False
|
||||||
|
|
||||||
def _request_buddy_icon(self, buddy):
|
def _request_buddy_icon(self, buddy):
|
||||||
writer = self.new_buddy_writer(buddy)
|
writer = self.new_buddy_writer(buddy)
|
||||||
|
Loading…
Reference in New Issue
Block a user