comparison src/protocols/msn/notification.c @ 5322:a4d017bee1de

[gaim-migrate @ 5694] Dragging buddies into different groups now moves them server-side. You may have some bugs regarding this, or some errors. They should go away after they are moved into new groups. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 07 May 2003 01:53:04 +0000
parents bd98232872a3
children 29754a7d94e5
comparison
equal deleted inserted replaced
5321:21b303d09752 5322:a4d017bee1de
360 360
361 return TRUE; 361 return TRUE;
362 } 362 }
363 363
364 static gboolean 364 static gboolean
365 __adg_cmd(MsnServConn *servconn, const char *command, const char **params,
366 size_t param_count)
367 {
368 MsnSession *session = servconn->session;
369 gint *group_id;
370 char *group_name;
371
372 group_id = g_new(gint, 1);
373 *group_id = atoi(params[3]);
374
375 group_name = msn_url_decode(params[2]);
376
377 gaim_debug(GAIM_DEBUG_INFO, "msn", "Added group %s (id %d)\n",
378 group_name, group_id);
379
380 g_hash_table_insert(session->group_ids, group_name, group_id);
381 g_hash_table_insert(session->group_names, group_id, g_strdup(group_name));
382
383 return TRUE;
384 }
385
386 static gboolean
365 __blp_cmd(MsnServConn *servconn, const char *command, const char **params, 387 __blp_cmd(MsnServConn *servconn, const char *command, const char **params,
366 size_t param_count) 388 size_t param_count)
367 { 389 {
368 struct gaim_connection *gc = servconn->session->account->gc; 390 struct gaim_connection *gc = servconn->session->account->gc;
369 391
704 726
705 g_hash_table_replace(session->group_names, group_id, g_strdup(group_name)); 727 g_hash_table_replace(session->group_names, group_id, g_strdup(group_name));
706 728
707 g_hash_table_remove(session->group_ids, group_name); 729 g_hash_table_remove(session->group_ids, group_name);
708 g_hash_table_insert(session->group_ids, group_name, group_id); 730 g_hash_table_insert(session->group_ids, group_name, group_id);
731
732 return TRUE;
733 }
734
735 static gboolean
736 __rem_cmd(MsnServConn *servconn, const char *command, const char **params,
737 size_t param_count)
738 {
739 MsnSession *session = servconn->session;
740
741 /* I hate this. */
742 if (session->moving_buddy) {
743 struct gaim_connection *gc = session->account->gc;
744 const char *passport = params[3];
745 char outparams[MSN_BUF_LEN];
746
747 g_snprintf(outparams, sizeof(outparams), "FL %s %s %d",
748 passport, passport, session->dest_group_id);
749
750 session->moving_buddy = FALSE;
751 session->dest_group_id = 0;
752
753 if (!msn_servconn_send_command(session->notification_conn,
754 "ADD", outparams)) {
755 hide_login_progress(gc, _("Write error"));
756 signoff(gc);
757 }
758 }
709 759
710 return TRUE; 760 return TRUE;
711 } 761 }
712 762
713 /************************************************************************** 763 /**************************************************************************
1044 msn_servconn_set_failed_read_cb(notification, __failed_read_cb); 1094 msn_servconn_set_failed_read_cb(notification, __failed_read_cb);
1045 1095
1046 if (notification_commands == NULL) { 1096 if (notification_commands == NULL) {
1047 /* Register the command callbacks. */ 1097 /* Register the command callbacks. */
1048 msn_servconn_register_command(notification, "ADD", __add_cmd); 1098 msn_servconn_register_command(notification, "ADD", __add_cmd);
1099 msn_servconn_register_command(notification, "ADG", __adg_cmd);
1049 msn_servconn_register_command(notification, "BLP", __blp_cmd); 1100 msn_servconn_register_command(notification, "BLP", __blp_cmd);
1050 msn_servconn_register_command(notification, "BPR", __blank_cmd); 1101 msn_servconn_register_command(notification, "BPR", __blank_cmd);
1051 msn_servconn_register_command(notification, "CHG", __blank_cmd); 1102 msn_servconn_register_command(notification, "CHG", __blank_cmd);
1052 msn_servconn_register_command(notification, "CHL", __chl_cmd); 1103 msn_servconn_register_command(notification, "CHL", __chl_cmd);
1053 msn_servconn_register_command(notification, "FLN", __fln_cmd); 1104 msn_servconn_register_command(notification, "FLN", __fln_cmd);
1062 msn_servconn_register_command(notification, "PRP", __blank_cmd); 1113 msn_servconn_register_command(notification, "PRP", __blank_cmd);
1063 msn_servconn_register_command(notification, "QNG", __blank_cmd); 1114 msn_servconn_register_command(notification, "QNG", __blank_cmd);
1064 msn_servconn_register_command(notification, "QRY", __blank_cmd); 1115 msn_servconn_register_command(notification, "QRY", __blank_cmd);
1065 msn_servconn_register_command(notification, "REA", __rea_cmd); 1116 msn_servconn_register_command(notification, "REA", __rea_cmd);
1066 msn_servconn_register_command(notification, "REG", __reg_cmd); 1117 msn_servconn_register_command(notification, "REG", __reg_cmd);
1067 msn_servconn_register_command(notification, "REM", __blank_cmd); 1118 msn_servconn_register_command(notification, "REM", __rem_cmd);
1119 msn_servconn_register_command(notification, "RMG", __blank_cmd);
1068 msn_servconn_register_command(notification, "RNG", __rng_cmd); 1120 msn_servconn_register_command(notification, "RNG", __rng_cmd);
1069 msn_servconn_register_command(notification, "SYN", __blank_cmd); 1121 msn_servconn_register_command(notification, "SYN", __blank_cmd);
1070 msn_servconn_register_command(notification, "URL", __url_cmd); 1122 msn_servconn_register_command(notification, "URL", __url_cmd);
1071 msn_servconn_register_command(notification, "USR", __usr_cmd); 1123 msn_servconn_register_command(notification, "USR", __usr_cmd);
1072 msn_servconn_register_command(notification, "VER", __ver_cmd); 1124 msn_servconn_register_command(notification, "VER", __ver_cmd);