diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 119e330..46f3ff1 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -552,16 +552,6 @@ class Interface(object): data = store.get_value(position, 0) pic = data.avatar - if not pic in self._avatars: - # set the user avatar to the default image, so it won't get queued - # again. Once downloaded, the _post_download_pic will update the - # image and force a redraw. - self._avatars[pic] = self._images['avatar'] - self._threads.add_work(self._post_download_pic, - self._exception_download_pic, - self._download_pic, - pic) - cell.set_property('pixbuf', self._avatars[pic]) return @@ -1056,6 +1046,17 @@ class Interface(object): for message in results: _log.debug('Data: %s', str(message)) message.read = False + pic = message.avatar + if not pic in self._avatars: + # set the user avatar to the default image, so it won't get + # queued again. Once downloaded, the _post_download_pic will + # update the image and force a redraw. + self._avatars[pic] = self._images['avatar'] + self._threads.add_work(self._post_download_pic, + self._exception_download_pic, + self._download_pic, + pic) + store.prepend([message]) store.sort_column_changed() self._grid.queue_draw()