From: <ev...@us...> - 2006-12-22 08:33:17
|
Revision: 18046 http://svn.sourceforge.net/gaim/?rev=18046&view=rev Author: evands Date: 2006-12-22 00:33:12 -0800 (Fri, 22 Dec 2006) Log Message: ----------- When there is no away message specified in the info block and the contact is no longer away, clear the cached away message if there is one. Previously, when a contact did the following: 1. Away with Message 1 2. Available 3. Away with Message 2 the 3rd event would lead to setting away first with Message 1 (cached in the old user_info object) and then with Message 2 (using a newly created user_info object). I also changed 2 "#if 0" directives which together controlled logging unknown TLVs into "#ifdef LOG_UNKNOWN_TLV" and added a commented-out #define at the top of the file. Modified Paths: -------------- trunk/libgaim/protocols/oscar/family_locate.c Modified: trunk/libgaim/protocols/oscar/family_locate.c =================================================================== --- trunk/libgaim/protocols/oscar/family_locate.c 2006-12-22 08:29:28 UTC (rev 18045) +++ trunk/libgaim/protocols/oscar/family_locate.c 2006-12-22 08:33:12 UTC (rev 18046) @@ -31,6 +31,9 @@ #include "win32dep.h" #endif +/* Define to log unknown TLVs */ +/* #define LOG_UNKNOWN_TLV */ + /* * Capability blocks. * @@ -301,6 +304,21 @@ cur->away = NULL; cur->away_encoding = strdup(userinfo->away_encoding); cur->away_len = userinfo->away_len; + + } else if (!(userinfo->flags & AIM_FLAG_AWAY)) { + /* + * We don't have an away message specified in this user_info block. + * If the user is not away, clear any cached away message now. + */ + if (cur->away) { + free(cur->away); + cur->away = NULL; + } + if (cur->away_encoding) { + free(cur->away_encoding); + cur->away_encoding = NULL; + } + cur->away_len = 0; } /* @@ -525,7 +543,7 @@ return 0; } -#if 0 +#ifdef LOG_UNKNOWN_TLV static void dumptlv(OscarData *od, guint16 type, ByteStream *bs, guint8 len) { @@ -851,7 +869,7 @@ * recovery. * */ -#if 0 +#ifdef LOG_UNKNOWN_TLV gaim_debug_misc("oscar", "userinfo: **warning: unexpected TLV:\n"); gaim_debug_misc("oscar", "userinfo: sn =%s\n", outinfo->sn); dumptlv(od, type, bs, length); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |