ClickableNicknamesPlugin.[Andrey Musikhin].Insert nick in the middle of the message

This commit is contained in:
Denis Fomin
2013-02-21 00:13:25 +04:00
parent 6e4076c295
commit b2661b2132
2 changed files with 11 additions and 4 deletions

View File

@@ -126,10 +126,16 @@ class Base(object):
self.chat_control.room_jid)
if nick not in nicks:
return
message_buffer = self.chat_control.msg_textview.get_buffer()
if message_buffer.get_char_count() < 2:
if message_buffer.get_char_count() < 1:
nick = nick + gajim.config.get('gc_refer_to_nick_char')
nick = nick + ' '
else:
start, end = message_buffer.get_bounds()
if message_buffer.get_text(start, end, True)[-1] != ' ':
nick = ' ' + nick
nick += ' '
message_buffer.insert_at_cursor(nick)
self.chat_control.msg_textview.grab_focus()