Philipp Hörist pushed to branch master at gajim / gajim


Commits:
91bb8c33 by Philipp Hörist at 2019-12-26T23:29:33Z
ConversationTextview: Add nickname tag

This makes it easier for plugins to detect the nickname

- - - - -
85e0e0da by Philipp Hörist at 2019-12-26T23:30:15Z
MessageInput: Add insert_text()

For convenience

- - - - -


2 changed files:

- gajim/conversation_textview.py
- gajim/gtk/message_input.py


Changes:

=====================================
gajim/conversation_textview.py
=====================================
@@ -272,6 +272,9 @@ class ConversationTextview(GObject.GObject):
         textview_icon = buffer_.create_tag('textview-icon')
         textview_icon.set_property('rise', Pango.units_from_double(-2.45))
 
+        # To help plugins easily identify the nickname
+        buffer_.create_tag('nickname')
+
         tag = buffer_.create_tag('time_sometimes')
         tag.set_property('foreground', 'darkgrey')
         #Pango.SCALE_SMALL
@@ -1227,6 +1230,7 @@ class ConversationTextview(GObject.GObject):
             if other_tags_for_name:
                 name_tags = other_tags_for_name[:]  # create a new list
             name_tags.append(kind)
+            name_tags.append('nickname')
 
             for tag in name_tags:
                 if tag.startswith('muc_nickname_color_'):


=====================================
gajim/gtk/message_input.py
=====================================
@@ -117,6 +117,9 @@ class MessageInputTextView(Gtk.TextView):
             self.emit('text-changed', self.get_buffer())
             self._last_text = text
 
+    def insert_text(self, text):
+        self.get_buffer().insert_at_cursor(text)
+
     def has_text(self):
         buf = self.get_buffer()
         start, end = buf.get_bounds()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/209cd3c866c37384703f70c2401080fc0be07880...85e0e0da5c93763a28bd1ba9e06d52d7c9d869b6

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/209cd3c866c37384703f70c2401080fc0be07880...85e0e0da5c93763a28bd1ba9e06d52d7c9d869b6
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to