# HG changeset patch # User mikael # Date 1114690954 0 # Node ID 03be1cc945606a04305f941115012d0518dac8f6 # Parent 81ccb1091dd8b2a44f0687b029c34d7ffd776bc6 [/trunk] Changeset 142 by mikael * Do not enter chat mode when a command is entered. diff -r 81ccb1091dd8 -r 03be1cc94560 mcabber/src/commands.c --- a/mcabber/src/commands.c Thu Apr 28 10:16:32 2005 +0000 +++ b/mcabber/src/commands.c Thu Apr 28 12:22:34 2005 +0000 @@ -166,8 +166,16 @@ char *p; cmd *curcmd; - if (*line != '/') { - send_message(line); // FIXME: are we talking to a _buddy_? + if (*line == 0 || *line != '/') { + scr_set_chatmode(TRUE); + if (current_buddy) { + buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); + + if (!*line) + scr_ShowBuddyWindow(); + else + send_message(line); // FIXME: are we talking to a _buddy_? + } return 0; } diff -r 81ccb1091dd8 -r 03be1cc94560 mcabber/src/screen.c --- a/mcabber/src/screen.c Thu Apr 28 10:16:32 2005 +0000 +++ b/mcabber/src/screen.c Thu Apr 28 12:22:34 2005 +0000 @@ -789,6 +789,11 @@ doupdate(); } +inline void scr_set_chatmode(int enable) +{ + chatmode = enable; +} + // which_row() // Tells which row our cursor is in, in the command line. // -1 -> normal text @@ -982,13 +987,6 @@ check_offset(0); break; case '\n': // Enter - chatmode = TRUE; - if (current_buddy) - buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, TRUE); - if (inputLine[0] == 0) { - scr_ShowBuddyWindow(); - break; - } if (process_line(inputLine)) return 255; ptr_inputline = inputLine; diff -r 81ccb1091dd8 -r 03be1cc94560 mcabber/src/screen.h --- a/mcabber/src/screen.h Thu Apr 28 10:16:32 2005 +0000 +++ b/mcabber/src/screen.h Thu Apr 28 12:22:34 2005 +0000 @@ -26,6 +26,7 @@ void scr_WriteOutgoingMessage(const char *jidto, const char *text); void scr_ShowBuddyWindow(void); void scr_LogPrint(const char *fmt, ...); +inline void scr_set_chatmode(int enable); WINDOW *scr_GetInputWindow(void);