Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/screen.c @ 1783:af3de54ef986
Convert scr_LogPrint() to scr_log_print()
Add a #define for compatibility.
Same for scr_Write{Incoming,Outgoing}Message() functions.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 14 Mar 2010 12:48:21 +0100 |
parents | e4378fbab5d7 |
children | 6e0a8bfb3a01 |
comparison
equal
deleted
inserted
replaced
1782:97803c87d82d | 1783:af3de54ef986 |
---|---|
875 } else { | 875 } else { |
876 printf("%s %s\n", strtimestamp, string); | 876 printf("%s %s\n", strtimestamp, string); |
877 } | 877 } |
878 } | 878 } |
879 | 879 |
880 // scr_LogPrint(...) | 880 // scr_log_print(...) |
881 // Display a message in the log window and in the status buffer. | 881 // Display a message in the log window and in the status buffer. |
882 // Add the message to the tracelog file if the log flag is set. | 882 // Add the message to the tracelog file if the log flag is set. |
883 // This function will convert from UTF-8 unless the LPRINT_NOTUTF8 flag is set. | 883 // This function will convert from UTF-8 unless the LPRINT_NOTUTF8 flag is set. |
884 void scr_LogPrint(unsigned int flag, const char *fmt, ...) | 884 void scr_log_print(unsigned int flag, const char *fmt, ...) |
885 { | 885 { |
886 time_t timestamp; | 886 time_t timestamp; |
887 char strtimestamp[64]; | 887 char strtimestamp[64]; |
888 char *buffer, *btext; | 888 char *buffer, *btext; |
889 char *convbuf1 = NULL, *convbuf2 = NULL; | 889 char *convbuf1 = NULL, *convbuf2 = NULL; |
2090 if (xtext != (char*)text) | 2090 if (xtext != (char*)text) |
2091 g_free(xtext); | 2091 g_free(xtext); |
2092 } | 2092 } |
2093 | 2093 |
2094 // If prefix is NULL, HBB_PREFIX_IN is supposed. | 2094 // If prefix is NULL, HBB_PREFIX_IN is supposed. |
2095 void scr_WriteIncomingMessage(const char *jidfrom, const char *text, | 2095 void scr_write_incoming_message(const char *jidfrom, const char *text, |
2096 time_t timestamp, guint prefix, unsigned mucnicklen) | 2096 time_t timestamp, |
2097 guint prefix, unsigned mucnicklen) | |
2097 { | 2098 { |
2098 if (!(prefix & | 2099 if (!(prefix & |
2099 ~HBB_PREFIX_NOFLAG & ~HBB_PREFIX_HLIGHT & ~HBB_PREFIX_HLIGHT_OUT & | 2100 ~HBB_PREFIX_NOFLAG & ~HBB_PREFIX_HLIGHT & ~HBB_PREFIX_HLIGHT_OUT & |
2100 ~HBB_PREFIX_PGPCRYPT & ~HBB_PREFIX_OTRCRYPT)) | 2101 ~HBB_PREFIX_PGPCRYPT & ~HBB_PREFIX_OTRCRYPT)) |
2101 prefix |= HBB_PREFIX_IN; | 2102 prefix |= HBB_PREFIX_IN; |
2105 scr_log_urls(text); | 2106 scr_log_urls(text); |
2106 #endif | 2107 #endif |
2107 scr_write_message(jidfrom, text, timestamp, prefix, mucnicklen, NULL); | 2108 scr_write_message(jidfrom, text, timestamp, prefix, mucnicklen, NULL); |
2108 } | 2109 } |
2109 | 2110 |
2110 void scr_WriteOutgoingMessage(const char *jidto, const char *text, guint prefix, | 2111 void scr_write_outgoing_message(const char *jidto, const char *text, |
2111 gpointer xep184) | 2112 guint prefix, gpointer xep184) |
2112 { | 2113 { |
2113 GSList *roster_elt; | 2114 GSList *roster_elt; |
2114 roster_elt = roster_find(jidto, jidsearch, | 2115 roster_elt = roster_find(jidto, jidsearch, |
2115 ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM); | 2116 ROSTER_TYPE_USER|ROSTER_TYPE_AGENT|ROSTER_TYPE_ROOM); |
2116 | 2117 |