Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/hooks.c @ 115:33bff2c57293
[/trunk] Changeset 129 by mikael
* Decode UTF-8 before logging message to file.
author | mikael |
---|---|
date | Sun, 24 Apr 2005 20:50:16 +0000 |
parents | 8ac67e951eab |
children | 1e7e59775f12 |
comparison
equal
deleted
inserted
replaced
114:065d8368c36b | 115:33bff2c57293 |
---|---|
22 #include <screen.h> | 22 #include <screen.h> |
23 | 23 |
24 #include "hooks.h" | 24 #include "hooks.h" |
25 #include "roster.h" | 25 #include "roster.h" |
26 #include "histolog.h" | 26 #include "histolog.h" |
27 #include "utf8.h" | |
27 | 28 |
28 | 29 |
29 inline void hk_message_in(const char *jid, time_t timestamp, const char *msg) | 30 inline void hk_message_in(const char *jid, time_t timestamp, const char *msg) |
30 { | 31 { |
31 scr_WriteIncomingMessage(jid, msg); | 32 char *buffer = utf8_decode(msg); |
32 hlog_write_message(jid, timestamp, FALSE, msg); | 33 // XXX Maybe filter out special chars? |
34 scr_WriteIncomingMessage(jid, buffer); | |
35 hlog_write_message(jid, timestamp, FALSE, buffer); | |
36 free(buffer); | |
33 } | 37 } |
34 | 38 |
35 inline void hk_message_out(const char *jid, time_t timestamp, const char *msg) | 39 inline void hk_message_out(const char *jid, time_t timestamp, const char *msg) |
36 { | 40 { |
37 scr_WriteOutgoingMessage(jid, msg); | 41 scr_WriteOutgoingMessage(jid, msg); |