Mercurial > pidgin.yaz
changeset 21672:ab0fd591c7c5
We should have the check to make sure we only set our own display name here
too, even though this isn't (yet) a problem here
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Wed, 28 Nov 2007 01:30:04 +0000 |
parents | 12b165b013e4 |
children | f9738214f308 |
files | libpurple/protocols/msn/notification.c |
diffstat | 1 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/msn/notification.c Tue Nov 27 22:56:01 2007 +0000 +++ b/libpurple/protocols/msn/notification.c Wed Nov 28 01:30:04 2007 +0000 @@ -1181,14 +1181,27 @@ static void rea_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) { - /* TODO: This might be for us too */ - MsnSession *session; + PurpleAccount *account; PurpleConnection *gc; const char *friendly; + char *username; session = cmdproc->session; - gc = session->account->gc; + account = session->account; + username = g_strdup(purple_normalize(account, + purple_account_get_username(account))); + + /* Only set display name if our *own* friendly name changed! */ + if (strcmp(username, purple_normalize(account, cmd->params[2]))) + { + g_free(username); + return; + } + + g_free(username); + + gc = account->gc; friendly = purple_url_decode(cmd->params[3]); purple_connection_set_display_name(gc, friendly);