comparison libpurple/protocols/msn/notification.c @ 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 6de09629f091
children 7ac87187bbec
comparison
equal deleted inserted replaced
21671:12b165b013e4 21672:ab0fd591c7c5
1179 } 1179 }
1180 1180
1181 static void 1181 static void
1182 rea_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) 1182 rea_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
1183 { 1183 {
1184 /* TODO: This might be for us too */
1185
1186 MsnSession *session; 1184 MsnSession *session;
1185 PurpleAccount *account;
1187 PurpleConnection *gc; 1186 PurpleConnection *gc;
1188 const char *friendly; 1187 const char *friendly;
1188 char *username;
1189 1189
1190 session = cmdproc->session; 1190 session = cmdproc->session;
1191 gc = session->account->gc; 1191 account = session->account;
1192 username = g_strdup(purple_normalize(account,
1193 purple_account_get_username(account)));
1194
1195 /* Only set display name if our *own* friendly name changed! */
1196 if (strcmp(username, purple_normalize(account, cmd->params[2])))
1197 {
1198 g_free(username);
1199 return;
1200 }
1201
1202 g_free(username);
1203
1204 gc = account->gc;
1192 friendly = purple_url_decode(cmd->params[3]); 1205 friendly = purple_url_decode(cmd->params[3]);
1193 1206
1194 purple_connection_set_display_name(gc, friendly); 1207 purple_connection_set_display_name(gc, friendly);
1195 } 1208 }
1196 1209