Commit 6a4d2082 authored by Dicson's avatar Dicson Committed by Philipp Hörist
Browse files

[nicknames] Fix lost gc_refer_to_nick_char

parent 230b5b41
......@@ -14,7 +14,7 @@ class ClickableNicknames(GajimPlugin):
def init(self):
self.description = _('Clickable nicknames '
'in the conversation textview.')
self.config_dialog = None # ClickableNicknamesPluginConfigDialog(self)
self.config_dialog = None
self.gui_extension_points = {
'chat_control_base': (self.connect_with_chat_control,
self.disconnect_from_chat_control)}
......@@ -127,19 +127,16 @@ class Base(object):
return
message_buffer = self.chat_control.msg_textview.get_buffer()
if message_buffer.get_char_count() < 1:
nick = nick + app.config.get('gc_refer_to_nick_char')
else:
start, end = message_buffer.get_bounds()
if message_buffer.get_text(start, end, True)[-1] != ' ':
nick = ' ' + nick
nick += ' '
# delete PLACEHOLDER
start_iter = message_buffer.get_start_iter()
end_iter = message_buffer.get_end_iter()
start, end = message_buffer.get_bounds()
placeholder = self.chat_control.msg_textview.PLACEHOLDER
if message_buffer.get_text(start_iter, end_iter, False) == placeholder:
text = message_buffer.get_text(start, end, False)
if text == placeholder or len(text) == 0:
message_buffer.set_text('', -1)
nick = nick + app.config.get('gc_refer_to_nick_char')
elif len(text) > 0 and text[-1] != ' ':
nick = ' ' + nick
nick += ' '
message_buffer.insert_at_cursor(nick)
self.chat_control.msg_textview.grab_focus()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment