From 43fe19d73e0505766a79b3e4d550ae1053fba2b4 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 12 Feb 2009 13:12:38 +0000 Subject: [PATCH] add a small square ti differentiate room member's affiliation. Fixes #3964 --- src/groupchat_control.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index dd5af55fa..42cab6582 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -1047,6 +1047,21 @@ class GroupchatControl(ChatControlBase): name += ('\n' '%s') % (colorstring, gobject.markup_escape_text(status)) + if image.get_storage_type() == gtk.IMAGE_PIXBUF: + pixbuf1 = image.get_pixbuf().copy() + pixbuf2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 4, 4) + if gc_contact.affiliation == 'owner': + pixbuf2.fill(0xff0000ff) # Red + elif gc_contact.affiliation == 'admin': + pixbuf2.fill(0xffb200ff) # Oragne + elif gc_contact.affiliation == 'member': + pixbuf2.fill(0x00ff00ff) # Green + else: + pixbuf2.fill(0x000000ff) # Green + pixbuf2.composite(pixbuf1, 12, 12, pixbuf2.get_property('width'), + pixbuf2.get_property('height'), 0, 0, 1.0, 1.0, + gtk.gdk.INTERP_HYPER, 127) + image = gtk.image_new_from_pixbuf(pixbuf1) model[iter_][C_IMG] = image model[iter_][C_TEXT] = name