comparison mcabber/src/hooks.c @ 485:55aa45eb7ece

Fix a small display bug
author Mikael Berthe <mikael@lilotux.net>
date Fri, 07 Oct 2005 18:52:37 +0200
parents 00e2d3821a5b
children 21ab22a60bcb
comparison
equal deleted inserted replaced
484:00e2d3821a5b 485:55aa45eb7ece
119 inline void hk_message_out(const char *jid, const char *nick, 119 inline void hk_message_out(const char *jid, const char *nick,
120 time_t timestamp, const char *msg) 120 time_t timestamp, const char *msg)
121 { 121 {
122 char *wmsg = NULL, *bmsg = NULL; 122 char *wmsg = NULL, *bmsg = NULL;
123 123
124 if (nick) { 124 if (nick) wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", nick, msg);
125 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", nick, msg); 125 else wmsg = (char*)msg;
126 } else { 126
127 wmsg = (char*)msg; 127 // Note: the hlog_write should not be called first, because in some
128 // We don't log private messages 128 // cases scr_WriteOutgoingMessage() will load the history and we'd
129 hlog_write_message(jid, timestamp, TRUE, msg); 129 // have the message twice...
130 }
131
132 scr_WriteOutgoingMessage(jid, wmsg); 130 scr_WriteOutgoingMessage(jid, wmsg);
131
132 // We don't log private messages
133 if (!nick) hlog_write_message(jid, timestamp, TRUE, msg);
134
133 // External command 135 // External command
134 hk_ext_cmd(jid, 'M', 'S', NULL); 136 hk_ext_cmd(jid, 'M', 'S', NULL);
135 137
136 if (bmsg) g_free(bmsg); 138 if (bmsg) g_free(bmsg);
137 } 139 }