# HG changeset patch # User mikael # Date 1111951958 0 # Node ID 6a97e7cd00d9244c674bb3ee98f08c15b37e62e2 # Parent 7eeda3a06b213e43a15c1d53fe8e2f297692f680 [/trunk] Changeset 37 by mikael * Unexport the scr_SearchWindow() function. Use the new scr_IsHiddenMessage() function instead. diff -r 7eeda3a06b21 -r 6a97e7cd00d9 mcabber/TODO --- a/mcabber/TODO Sun Mar 27 18:52:11 2005 +0000 +++ b/mcabber/TODO Sun Mar 27 19:32:38 2005 +0000 @@ -1,5 +1,4 @@ -* un-export window internal structure, use a public function * pending message not displayed if buddy outside Contact window * Use libjabber @@ -19,7 +18,7 @@ * Handle window resize * Command line completion * Scroll back history -* Save history +* Save history * Shortcut to jump to next message received (shift-tab?) * File transfer? :) * Conferences :) diff -r 7eeda3a06b21 -r 6a97e7cd00d9 mcabber/buddies.c --- a/mcabber/buddies.c Sun Mar 27 18:52:11 2005 +0000 +++ b/mcabber/buddies.c Sun Mar 27 19:32:38 2005 +0000 @@ -217,7 +217,6 @@ int n; int maxx, maxy; int fakeOffset = buddyOffset; - window_entry_t *wintmp; getmaxyx(win, maxy, maxx); @@ -242,16 +241,7 @@ } tmp = buddy_entry(pos); - // FIXME: we should create a function instead of exporting this! :-( - // Cf. revision ~28 - wintmp = scr_SearchWindow(tmp->jid); - /* - if (wintmp) - scr_LogPrint("wintmp != NULL"); - else - scr_LogPrint("wintmp == NULL"); - */ - if ((wintmp) && (wintmp->hidden_msg)) { + if (scr_IsHiddenMessage(tmp->jid)) { pending = '#'; } diff -r 7eeda3a06b21 -r 6a97e7cd00d9 mcabber/screen.c --- a/mcabber/screen.c Sun Mar 27 18:52:11 2005 +0000 +++ b/mcabber/screen.c Sun Mar 27 19:32:38 2005 +0000 @@ -13,12 +13,24 @@ #include "parsecfg.h" #include "lang.h" #include "server.h" +#include "list.h" /* Definicion de tipos */ #define window_entry(n) list_entry(n, window_entry_t, list) LIST_HEAD(window_list); +typedef struct _window_entry_t { + WINDOW *win; + PANEL *panel; + char *name; + int nlines; + char **texto; + int hidden_msg; + struct list_head list; +} window_entry_t; + + /* Variables globales a SCREEN.C */ static WINDOW *rosterWnd, *chatWnd, *inputWnd; static WINDOW *logWnd, *logWnd_border; @@ -588,6 +600,18 @@ doupdate(); } +// scr_IsHiddenMessage(jid) +// Returns TRUE if there is a hidden message in the window +// for the jid contact. +int scr_IsHiddenMessage(char *jid) { + window_entry_t *wintmp; + + wintmp = scr_SearchWindow(jid); + if ((wintmp) && (wintmp->hidden_msg)) + return TRUE; + + return FALSE; +} void send_message(int sock, char *msg) { diff -r 7eeda3a06b21 -r 6a97e7cd00d9 mcabber/screen.h --- a/mcabber/screen.h Sun Mar 27 18:52:11 2005 +0000 +++ b/mcabber/screen.h Sun Mar 27 19:32:38 2005 +0000 @@ -2,9 +2,6 @@ #define __SCREEN_H__ 1 #include -#include - -#include "list.h" #define COLOR_POPUP 1 #define COLOR_GENERAL 3 @@ -18,17 +15,6 @@ #define INPUTLINE_LENGTH 1024 - -typedef struct _window_entry_t { - WINDOW *win; - PANEL *panel; - char *name; - int nlines; - char **texto; - int hidden_msg; - struct list_head list; -} window_entry_t; - extern int update_roaster; void scr_InitCurses(void); @@ -42,7 +28,8 @@ void scr_RoolWindow(void); void scr_ShowBuddyWindow(void); void scr_LogPrint(const char *fmt, ...); -window_entry_t *scr_SearchWindow(char *winId); + +int scr_IsHiddenMessage(char *jid); WINDOW *scr_GetRosterWindow(void); WINDOW *scr_GetStatusWindow(void);