Mercurial > hg
comparison mcabber/src/screen.c @ 726:51be2bc1a820
Better tab expansion
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 05 Mar 2006 19:09:17 +0100 |
parents | 1aff92625bdb |
children | 1c3620668857 |
comparison
equal
deleted
inserted
replaced
725:1aff92625bdb | 726:51be2bc1a820 |
---|---|
976 } | 976 } |
977 | 977 |
978 inline void scr_WriteMessage(const char *jid, const char *text, | 978 inline void scr_WriteMessage(const char *jid, const char *text, |
979 time_t timestamp, guint prefix_flags) | 979 time_t timestamp, guint prefix_flags) |
980 { | 980 { |
981 if (!timestamp) timestamp = time(NULL); | |
982 | |
983 scr_WriteInWindow(jid, text, timestamp, prefix_flags, FALSE); | |
984 } | |
985 | |
986 // If prefix is NULL, HBB_PREFIX_IN is supposed. | |
987 void scr_WriteIncomingMessage(const char *jidfrom, const char *text, | |
988 time_t timestamp, guint prefix) | |
989 { | |
990 char *p, *xtext; | 981 char *p, *xtext; |
991 guint8 n =0; | 982 guint8 n =0; |
992 | 983 |
993 if (!(prefix & ~HBB_PREFIX_NOFLAG)) | 984 if (!timestamp) timestamp = time(NULL); |
994 prefix |= HBB_PREFIX_IN; | |
995 | 985 |
996 xtext = (char*)text; | 986 xtext = (char*)text; |
997 | 987 |
998 // Expand tabs | 988 // Expand tabs |
999 for (p=xtext; *p; p++) | 989 for (p=xtext; *p; p++) |
1010 *q++ = *p; | 1000 *q++ = *p; |
1011 } | 1001 } |
1012 } while (*p++); | 1002 } while (*p++); |
1013 } | 1003 } |
1014 | 1004 |
1015 // FIXME Filter out special chars... | 1005 // XXX Are there other special chars we should filter out? |
1016 scr_WriteMessage(jidfrom, xtext, timestamp, prefix); | 1006 |
1007 scr_WriteInWindow(jid, xtext, timestamp, prefix_flags, FALSE); | |
1008 | |
1009 if (xtext != (char*)text) | |
1010 g_free(xtext); | |
1011 } | |
1012 | |
1013 // If prefix is NULL, HBB_PREFIX_IN is supposed. | |
1014 void scr_WriteIncomingMessage(const char *jidfrom, const char *text, | |
1015 time_t timestamp, guint prefix) | |
1016 { | |
1017 if (!(prefix & ~HBB_PREFIX_NOFLAG)) | |
1018 prefix |= HBB_PREFIX_IN; | |
1019 | |
1020 scr_WriteMessage(jidfrom, text, timestamp, prefix); | |
1017 update_panels(); | 1021 update_panels(); |
1018 doupdate(); | 1022 doupdate(); |
1019 | |
1020 if (xtext != (char*)text) | |
1021 g_free(xtext); | |
1022 } | 1023 } |
1023 | 1024 |
1024 void scr_WriteOutgoingMessage(const char *jidto, const char *text) | 1025 void scr_WriteOutgoingMessage(const char *jidto, const char *text) |
1025 { | 1026 { |
1026 scr_WriteMessage(jidto, text, 0, HBB_PREFIX_OUT); | 1027 scr_WriteMessage(jidto, text, 0, HBB_PREFIX_OUT); |