changeset 129:03be1cc94560

[/trunk] Changeset 142 by mikael * Do not enter chat mode when a command is entered.
author mikael
date Thu, 28 Apr 2005 12:22:34 +0000
parents 81ccb1091dd8
children 60694c9ddde3
files mcabber/src/commands.c mcabber/src/screen.c mcabber/src/screen.h
diffstat 3 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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;
   }
 
--- 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;
--- 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);