src/protocols/msn/notification.c

changeset 5361
a964b856e97f
parent 5358
efa9128e93fe
child 5363
b6e28be0c9bd
equal deleted inserted replaced
5360:ecae882d799f 5361:a964b856e97f
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 21 */
22 #include "msn.h" 22 #include "msn.h"
23 #include "notification.h" 23 #include "notification.h"
24 #include "away.h" 24 #include "state.h"
25 #include "error.h" 25 #include "error.h"
26 #include "utils.h" 26 #include "utils.h"
27 27
28 typedef struct 28 typedef struct
29 { 29 {
426 426
427 return TRUE; 427 return TRUE;
428 } 428 }
429 429
430 static gboolean 430 static gboolean
431 __bpr_cmd(MsnServConn *servconn, const char *command, const char **params,
432 size_t param_count)
433 {
434 struct gaim_connection *gc = servconn->session->account->gc;
435 struct buddy *b;
436 const char *passport, *type, *value;
437 int status = 0;
438
439 passport = params[1];
440 type = params[2];
441 value = params[3];
442
443 if (!strcmp(type, "MOB")) {
444 if (value != NULL && !strcmp(value, "Y")) {
445 gaim_debug(GAIM_DEBUG_MISC, "msn",
446 "%s has a pager\n", passport);
447 if ((b = gaim_find_buddy(gc->account, passport)) != NULL) {
448 status = b->uc | (1 << 5);
449
450 serv_got_update(gc, (char *)passport, 1, 0, 0, 0, status);
451 }
452 }
453 }
454
455 return TRUE;
456 }
457
458 static gboolean
431 __fln_cmd(MsnServConn *servconn, const char *command, const char **params, 459 __fln_cmd(MsnServConn *servconn, const char *command, const char **params,
432 size_t param_count) 460 size_t param_count)
433 { 461 {
434 struct gaim_connection *gc = servconn->session->account->gc; 462 struct gaim_connection *gc = servconn->session->account->gc;
435 463
443 size_t param_count) 471 size_t param_count)
444 { 472 {
445 struct gaim_connection *gc = servconn->session->account->gc; 473 struct gaim_connection *gc = servconn->session->account->gc;
446 int status = 0; 474 int status = 0;
447 const char *state, *passport, *friend; 475 const char *state, *passport, *friend;
476 struct buddy *b;
448 477
449 state = params[1]; 478 state = params[1];
450 passport = params[2]; 479 passport = params[2];
451 friend = msn_url_decode(params[3]); 480 friend = msn_url_decode(params[3]);
452 481
453 serv_got_alias(gc, (char *)passport, (char *)friend); 482 serv_got_alias(gc, (char *)passport, (char *)friend);
483
484 if ((b = gaim_find_buddy(gc->account, passport)) != NULL)
485 status |= ((((b->uc) >> 1) & 0xF0) << 1);
454 486
455 if (!g_ascii_strcasecmp(state, "BSY")) 487 if (!g_ascii_strcasecmp(state, "BSY"))
456 status |= UC_UNAVAILABLE | (MSN_BUSY << 1); 488 status |= UC_UNAVAILABLE | (MSN_BUSY << 1);
457 else if (!g_ascii_strcasecmp(state, "IDL")) 489 else if (!g_ascii_strcasecmp(state, "IDL"))
458 status |= UC_UNAVAILABLE | (MSN_IDLE << 1); 490 status |= UC_UNAVAILABLE | (MSN_IDLE << 1);
1195 if (notification_commands == NULL) { 1227 if (notification_commands == NULL) {
1196 /* Register the command callbacks. */ 1228 /* Register the command callbacks. */
1197 msn_servconn_register_command(notification, "ADD", __add_cmd); 1229 msn_servconn_register_command(notification, "ADD", __add_cmd);
1198 msn_servconn_register_command(notification, "ADG", __adg_cmd); 1230 msn_servconn_register_command(notification, "ADG", __adg_cmd);
1199 msn_servconn_register_command(notification, "BLP", __blp_cmd); 1231 msn_servconn_register_command(notification, "BLP", __blp_cmd);
1200 msn_servconn_register_command(notification, "BPR", __blank_cmd); 1232 msn_servconn_register_command(notification, "BPR", __bpr_cmd);
1201 msn_servconn_register_command(notification, "CHG", __blank_cmd); 1233 msn_servconn_register_command(notification, "CHG", __blank_cmd);
1202 msn_servconn_register_command(notification, "CHL", __chl_cmd); 1234 msn_servconn_register_command(notification, "CHL", __chl_cmd);
1203 msn_servconn_register_command(notification, "FLN", __fln_cmd); 1235 msn_servconn_register_command(notification, "FLN", __fln_cmd);
1204 msn_servconn_register_command(notification, "GTC", __blank_cmd); 1236 msn_servconn_register_command(notification, "GTC", __blank_cmd);
1205 msn_servconn_register_command(notification, "ILN", __iln_cmd); 1237 msn_servconn_register_command(notification, "ILN", __iln_cmd);

mercurial