From: <ro...@us...> - 2006-06-11 21:48:47
|
Revision: 16260 Author: roast Date: 2006-06-11 14:48:41 -0700 (Sun, 11 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16260&view=rev Log Message: ----------- added support for gaim:message.self for conversations that are with yourself Modified Paths: -------------- branches/soc-2006-file-loggers/src/log.c Modified: branches/soc-2006-file-loggers/src/log.c =================================================================== --- branches/soc-2006-file-loggers/src/log.c 2006-06-11 19:28:26 UTC (rev 16259) +++ branches/soc-2006-file-loggers/src/log.c 2006-06-11 21:48:41 UTC (rev 16260) @@ -1029,10 +1029,26 @@ written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" gaim:type=\"whisper\">%s</message>\n", date, from, msg_fixed); } else if (type & GAIM_MESSAGE_AUTO_RESP && (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV)) { - written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\" auto=\"true\">%s</message>\n", date, from, msg_fixed); + gboolean selfsending = FALSE; + if (!g_ascii_strncasecmp(gaim_account_get_username(log->account), + gaim_account_get_username(log->conv->account), + strlen(gaim_account_get_username(log->account)))) { + selfsending = (type & GAIM_MESSAGE_RECV); + } + + written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\"%s auto=\"true\">%s</message>\n", + date, from, selfsending ? " gaim:self=\"true\"" : "", msg_fixed); } else if (type & GAIM_MESSAGE_SEND || type & GAIM_MESSAGE_RECV) { - written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\">%s</message>\n", date, from, msg_fixed); + gboolean selfsending = FALSE; + if (!g_ascii_strncasecmp(gaim_account_get_username(log->account), + gaim_account_get_username(log->conv->account), + strlen(gaim_account_get_username(log->account)))) { + selfsending = (type & GAIM_MESSAGE_RECV); + } + + written += fprintf(data->file, "\t<message time=\"%s\" sender=\"%s\"%s>%s</message>\n", + date, from, selfsending ? " gaim:self=\"true\"" : "", msg_fixed); } else { gaim_debug_error("log", "Unhandled message type."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |