Mercurial > hg
comparison mcabber/src/help.c @ 892:94bb9e40e40b
Set the pending message flag on the status buffer when using /help
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 31 May 2006 23:16:55 +0200 |
parents | c3c2f7a0c5d5 |
children | 2de8f8ba1f34 |
comparison
equal
deleted
inserted
replaced
891:78f4971578dd | 892:94bb9e40e40b |
---|---|
26 #include <glib.h> | 26 #include <glib.h> |
27 | 27 |
28 #include "settings.h" | 28 #include "settings.h" |
29 #include "logprint.h" | 29 #include "logprint.h" |
30 #include "utils.h" | 30 #include "utils.h" |
31 #include "screen.h" | |
31 | 32 |
32 #define DEFAULT_LANG "en" | 33 #define DEFAULT_LANG "en" |
33 | 34 |
34 // get_lang() | 35 // get_lang() |
35 // Return the language code string (a 2-letters string). | 36 // Return the language code string (a 2-letters string). |
61 const char *lang; | 62 const char *lang; |
62 FILE *fp; | 63 FILE *fp; |
63 char *helpfiles_dir, *filename; | 64 char *helpfiles_dir, *filename; |
64 char *data; | 65 char *data; |
65 const int datasize = 4096; | 66 const int datasize = 4096; |
67 int linecount = 0; | |
66 char *p; | 68 char *p; |
67 | 69 |
68 // Check string is ok | 70 // Check string is ok |
69 for (p = string; p && *p; p++) { | 71 for (p = string; p && *p; p++) { |
70 if (!isalnum(*p) && *p != '_' && *p != '-') { | 72 if (!isalnum(*p) && *p != '_' && *p != '-') { |
102 p--; | 104 p--; |
103 if (*p == '\n' || *p == '\r') | 105 if (*p == '\n' || *p == '\r') |
104 *p = '\0'; | 106 *p = '\0'; |
105 // Displaty the help line | 107 // Displaty the help line |
106 scr_LogPrint(LPRINT_NORMAL, "%s", data); | 108 scr_LogPrint(LPRINT_NORMAL, "%s", data); |
109 linecount++; | |
107 } | 110 } |
108 fclose(fp); | 111 fclose(fp); |
109 g_free(data); | 112 g_free(data); |
113 | |
114 if (linecount) { | |
115 scr_setmsgflag_if_needed(SPECIAL_BUFFER_STATUS_ID, TRUE); | |
116 update_roster = TRUE; | |
117 } | |
110 | 118 |
111 return 0; | 119 return 0; |
112 #endif /* DATA_DIR */ | 120 #endif /* DATA_DIR */ |
113 } | 121 } |
114 | 122 |