From: Nathan W. <fac...@us...> - 2003-07-08 04:05:07
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv29477/src Modified Files: conversation.c Log Message: a better fix for things that don't set the display_name for a GaimConnection Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.530 retrieving revision 1.531 diff -u -d -r1.530 -r1.531 --- conversation.c 7 Jul 2003 14:58:34 -0000 1.530 +++ conversation.c 8 Jul 2003 04:05:02 -0000 1.531 @@ -82,6 +82,7 @@ { GaimAccount *account; char *msg, *who, *p; + const char *disp; int n; account = gaim_connection_get_account(gc); @@ -102,26 +103,31 @@ g_free(who); - if (!gaim_utf8_strcasecmp(gaim_account_get_username(account), - gaim_connection_get_display_name(gc))) { - g_free(msg); - - return FALSE; - } + disp = gaim_connection_get_display_name(gc); - who = g_utf8_strdown(gaim_connection_get_display_name(gc), -1); - n = who ? strlen(who) : 0; - if (n > 0 && (p = strstr(msg, who)) != NULL) { - if ((p == msg || !isalnum(*(p - 1))) && !isalnum(*(p + n))) { - g_free(who); + if(disp) { + if (!gaim_utf8_strcasecmp(gaim_account_get_username(account), disp)) { g_free(msg); - return TRUE; + return FALSE; + } + + who = g_utf8_strdown(disp, -1); + n = who ? strlen(who) : 0; + + if (n > 0 && (p = strstr(msg, who)) != NULL) { + if ((p == msg || !isalnum(*(p - 1))) && !isalnum(*(p + n))) { + g_free(who); + g_free(msg); + + return TRUE; + } } + + g_free(who); } - g_free(who); g_free(msg); return FALSE; @@ -1855,11 +1861,13 @@ if (!(flags & WFLAG_WHISPER)) { char *str; + const char *disp; str = g_strdup(normalize(who)); + disp = gaim_connection_get_display_name(gc); if (!gaim_utf8_strcasecmp(str, normalize(gaim_account_get_username(account))) || - !gaim_utf8_strcasecmp(str, normalize(gaim_connection_get_display_name(gc)))) { + (disp && !gaim_utf8_strcasecmp(str, normalize(disp)))) { flags |= WFLAG_SEND; } @@ -1869,7 +1877,7 @@ if (find_nick(gc, message)) flags |= WFLAG_NICK; } - + g_free(str); } |