Add some comments; retry icon requests after a bit

This commit is contained in:
Dan Williams 2006-05-22 14:27:35 -04:00
parent 84ae7feb3a
commit 30f3c73dcb

View File

@ -322,6 +322,7 @@ class Chat(activity.Activity):
buf.insert(aniter, "\n") buf.insert(aniter, "\n")
def _get_first_richtext_chunk(self, msg): def _get_first_richtext_chunk(self, msg):
"""Scan the message for the first richtext-tagged chunk and return it."""
rt_last = -1 rt_last = -1
tag_rt_start = "<richtext>" tag_rt_start = "<richtext>"
tag_rt_end = "</richtext>" tag_rt_end = "</richtext>"
@ -335,6 +336,7 @@ class Chat(activity.Activity):
return None return None
def _get_first_sketch_chunk(self, msg): def _get_first_sketch_chunk(self, msg):
"""Scan the message for the first SVG-tagged chunk and return it."""
svg_last = -1 svg_last = -1
tag_svg_start = "<svg" tag_svg_start = "<svg"
tag_svg_end = "</svg>" tag_svg_end = "</svg>"
@ -567,6 +569,9 @@ class GroupChat(Chat):
icon = base64.b64decode(icon) icon = base64.b64decode(icon)
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)
else:
# What the heck, try again!
gobject.timeout_add(1000, self._request_buddy_icon, buddy)
def _request_buddy_icon(self, buddy): def _request_buddy_icon(self, buddy):
writer = self.new_buddy_writer(buddy, threaded=True) writer = self.new_buddy_writer(buddy, threaded=True)