Use the same code path for shift-enter as for ctrl-enter.

This commit is contained in:
Tomasz Miąsko 2017-01-25 17:13:41 +01:00
parent 0b7d6cc175
commit b678165d7d
1 changed files with 5 additions and 4 deletions

View File

@ -678,14 +678,15 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
return True
elif event.keyval == Gdk.KEY_Return or \
event.keyval == Gdk.KEY_KP_Enter: # ENTER
if event_state & Gdk.ModifierType.SHIFT_MASK:
return False
message_textview = widget
message_buffer = message_textview.get_buffer()
start_iter, end_iter = message_buffer.get_bounds()
message = message_buffer.get_text(start_iter, end_iter, False)
xhtml = self.msg_textview.get_xhtml()
if event_state & Gdk.ModifierType.SHIFT_MASK:
send_message = False
else:
is_ctrl_enter = bool(event_state & Gdk.ModifierType.CONTROL_MASK)
send_message = is_ctrl_enter == gajim.config.get('send_on_ctrl_enter')