cpw.qulogic.msn: e2a8133c: A patch from felipec to consistently use...
qulogic at pidgin.im
qulogic at pidgin.im
Mon Jun 23 01:56:39 EDT 2008
-----------------------------------------------------------------
Revision: e2a8133c3648a1a37576ade5e67c46730885e40e
Ancestor: 30bc11fb0f287ef49ab01b130617f89c53ab47a3
Author: qulogic at pidgin.im
Date: 2008-06-22T21:31:58
Branch: im.pidgin.cpw.qulogic.msn
URL: http://d.pidgin.im/viewmtn/revision/info/e2a8133c3648a1a37576ade5e67c46730885e40e
Modified files:
libpurple/protocols/msn/notification.c
libpurple/protocols/msn/user.c
ChangeLog:
A patch from felipec to consistently use NULL for the status of offline
MSN buddies.
References #5377.
And http://pidgin.im/pipermail/devel/2008-June/006136.html
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c ec9409b03207ba28182f0823c0bed9cfd76da308
+++ libpurple/protocols/msn/notification.c 569d15500cfeb7e0bde8b2149cdd70531b4c0e20
@@ -980,7 +980,7 @@ fln_cmd(MsnCmdProc *cmdproc, MsnCommand
/* Tell libpurple that the user has signed off */
user = msn_userlist_find_user(cmdproc->session->userlist, cmd->params[0]);
- user->status = "offline";
+ msn_user_set_state(user, NULL);
msn_user_update(user);
/* If we have an open MsnSlpLink with the user then close it */
============================================================
--- libpurple/protocols/msn/user.c b17370b7e58d44e79034a405f924909254fc8fb6
+++ libpurple/protocols/msn/user.c ec67b73ba2f52576bcde545f78ecb89621e8f6bc
@@ -82,37 +82,36 @@ msn_user_update(MsnUser *user)
msn_user_update(MsnUser *user)
{
PurpleAccount *account;
+ gboolean offline;
account = user->userlist->session->account;
- if (user->status != NULL) {
- gboolean offline = (strcmp(user->status, "offline") == 0);
+ offline = (user->status == NULL);
- if (!offline) {
- purple_prpl_got_user_status(account, user->passport, user->status,
- "message", user->statusline, NULL);
+ if (!offline) {
+ purple_prpl_got_user_status(account, user->passport, user->status,
+ "message", user->statusline, NULL);
+ } else {
+ if (user->mobile) {
+ purple_prpl_got_user_status(account, user->passport, "mobile", NULL);
+ purple_prpl_got_user_status(account, user->passport, "available", NULL);
} else {
- if (user->mobile) {
- purple_prpl_got_user_status(account, user->passport, "mobile", NULL);
- purple_prpl_got_user_status(account, user->passport, "available", NULL);
- } else {
- purple_prpl_got_user_status(account, user->passport, user->status, NULL);
- }
+ purple_prpl_got_user_status(account, user->passport, "offline", NULL);
}
+ }
- if (!offline || !user->mobile) {
- purple_prpl_got_user_status_deactive(account, user->passport, "mobile");
- }
+ if (!offline || !user->mobile) {
+ purple_prpl_got_user_status_deactive(account, user->passport, "mobile");
+ }
- if (!offline && user->media.title) {
- purple_prpl_got_user_status(account, user->passport, "tune",
- PURPLE_TUNE_ARTIST, user->media.artist,
- PURPLE_TUNE_ALBUM, user->media.album,
- PURPLE_TUNE_TITLE, user->media.title,
- NULL);
- } else {
- purple_prpl_got_user_status_deactive(account, user->passport, "tune");
- }
+ if (!offline && user->media.title) {
+ purple_prpl_got_user_status(account, user->passport, "tune",
+ PURPLE_TUNE_ARTIST, user->media.artist,
+ PURPLE_TUNE_ALBUM, user->media.album,
+ PURPLE_TUNE_TITLE, user->media.title,
+ NULL);
+ } else {
+ purple_prpl_got_user_status_deactive(account, user->passport, "tune");
}
if (user->idle)
@@ -126,6 +125,11 @@ msn_user_set_state(MsnUser *user, const
{
const char *status;
+ if (state == NULL) {
+ user->status = NULL;
+ return;
+ }
+
if (!g_ascii_strcasecmp(state, "BSY"))
status = "busy";
else if (!g_ascii_strcasecmp(state, "BRB"))
More information about the Commits
mailing list