[/trunk] Changeset 142 by mikael
* Do not enter chat mode when a command is entered.
--- 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);