Mercurial > pidgin.yaz
diff src/protocols/msn/user.c @ 10451:92d4a25fd33c
[gaim-migrate @ 11717]
This is patch 1090620 from Felipe Contreras to improve the handling of the
Individuals group on MSN and better buddy updates (modified by me to work in
HEAD)
Also included is my fix for bug 1090087 "MSN Groupchat Double Invite Crash",
a few spelling corrections, and make some more strings translatable.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Thu, 30 Dec 2004 15:55:19 +0000 |
parents | 088633feb846 |
children | 0f7452b1f777 |
line wrap: on
line diff
--- a/src/protocols/msn/user.c Thu Dec 30 06:26:53 2004 +0000 +++ b/src/protocols/msn/user.c Thu Dec 30 15:55:19 2004 +0000 @@ -86,6 +86,49 @@ } void +msn_user_update(MsnUser *user) +{ + GaimAccount *account; + GaimConnection *gc; + + account = user->userlist->session->account; + gc = gaim_account_get_connection(account); + + gaim_prpl_got_user_status(account, user->passport, user->status, NULL); + + if (user->idle) + gaim_prpl_got_user_idle(account, user->passport, TRUE, -1); + else + gaim_prpl_got_user_idle(account, user->passport, FALSE, 0); +} + +void +msn_user_set_state(MsnUser *user, const char *state) +{ + const char *status; + + if (!g_ascii_strcasecmp(state, "BSY")) + status = "busy"; + else if (!g_ascii_strcasecmp(state, "BRB")) + status = "brb"; + else if (!g_ascii_strcasecmp(state, "AWY")) + status = "away"; + else if (!g_ascii_strcasecmp(state, "PHN")) + status = "phone"; + else if (!g_ascii_strcasecmp(state, "LUN")) + status = "lunch"; + else + status = "available"; + + if (!g_ascii_strcasecmp(state, "IDL")) + user->idle = TRUE; + else + user->idle = FALSE; + + user->status = status; +} + +void msn_user_set_passport(MsnUser *user, const char *passport) { g_return_if_fail(user != NULL); @@ -222,6 +265,12 @@ g = gaim_find_group(group_name); + if ((id == 0) && (g == NULL)) + { + g = gaim_group_new(group_name); + gaim_blist_add_group(g, NULL); + } + b = gaim_find_buddy_in_group(account, passport, g); if (b == NULL)