diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2013-05-12 23:32:29 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2013-05-12 23:32:29 +0400 |
commit | a14c758d06e990899aa4cef299137ed4b9acb787 (patch) | |
tree | 6a50ab012dd8d68b9b48789dab8ac7dce1cba646 /src/conversation_textview.py | |
parent | 5cf946f53c965de916f70f51766c65e329cea822 (diff) |
- regroup display PEP info in roster options
- add option to show positive XEP-0184 ack in message window. Fixes 7341
Diffstat (limited to 'src/conversation_textview.py')
-rw-r--r-- | src/conversation_textview.py | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/conversation_textview.py b/src/conversation_textview.py index 2c56cc8e6..e97d5801e 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -176,6 +176,8 @@ class ConversationTextview(GObject.GObject): 'gajim-muc_separator') XEP0184_WARNING_PIXBUF = gtkgui_helpers.get_icon_pixmap( 'gajim-receipt_missing') + XEP0184_RECEIVED_PIXBUF = gtkgui_helpers.get_icon_pixmap( + 'gajim-receipt_received') MESSAGE_CORRECTED_PIXBUF = gtkgui_helpers.get_icon_pixmap( 'gajim-message_corrected') @@ -554,22 +556,29 @@ class ConversationTextview(GObject.GObject): if id_ not in self.xep0184_marks: return - if self.xep0184_shown[id_] == NOT_SHOWN: - self.xep0184_shown[id_] = ALREADY_RECEIVED - return - buffer_ = self.tv.get_buffer() buffer_.begin_user_action() - begin_iter = buffer_.get_iter_at_mark(self.xep0184_marks[id_]) + if self.xep0184_shown[id_] != NOT_SHOWN: + begin_iter = buffer_.get_iter_at_mark(self.xep0184_marks[id_]) + + end_iter = begin_iter.copy() + # XXX: Is there a nicer way? + end_iter.forward_char() + end_iter.forward_char() + + buffer_.delete(begin_iter, end_iter) - end_iter = begin_iter.copy() - # XXX: Is there a nicer way? - end_iter.forward_char() - end_iter.forward_char() + if gajim.config.get('positive_184_ack'): + begin_iter = buffer_.get_iter_at_mark(self.xep0184_marks[id_]) + buffer_.insert(begin_iter, ' ') + anchor = buffer_.create_child_anchor(begin_iter) + img = TextViewImage(anchor, '') + img.set_from_pixbuf(ConversationTextview.XEP0184_RECEIVED_PIXBUF) + img.show() + self.tv.add_child_at_anchor(img, anchor) - buffer_.delete(begin_iter, end_iter) - buffer_.delete_mark(self.xep0184_marks[id_]) + self.xep0184_shown[id_] = ALREADY_RECEIVED buffer_.end_user_action() |