Mercurial > pidgin
diff 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 |
line wrap: on
line diff
--- a/src/protocols/msn/notification.c Wed May 07 01:41:07 2003 +0000 +++ b/src/protocols/msn/notification.c Wed May 07 01:53:04 2003 +0000 @@ -362,6 +362,28 @@ } static gboolean +__adg_cmd(MsnServConn *servconn, const char *command, const char **params, + size_t param_count) +{ + MsnSession *session = servconn->session; + gint *group_id; + char *group_name; + + group_id = g_new(gint, 1); + *group_id = atoi(params[3]); + + group_name = msn_url_decode(params[2]); + + gaim_debug(GAIM_DEBUG_INFO, "msn", "Added group %s (id %d)\n", + group_name, group_id); + + g_hash_table_insert(session->group_ids, group_name, group_id); + g_hash_table_insert(session->group_names, group_id, g_strdup(group_name)); + + return TRUE; +} + +static gboolean __blp_cmd(MsnServConn *servconn, const char *command, const char **params, size_t param_count) { @@ -710,6 +732,34 @@ return TRUE; } +static gboolean +__rem_cmd(MsnServConn *servconn, const char *command, const char **params, + size_t param_count) +{ + MsnSession *session = servconn->session; + + /* I hate this. */ + if (session->moving_buddy) { + struct gaim_connection *gc = session->account->gc; + const char *passport = params[3]; + char outparams[MSN_BUF_LEN]; + + g_snprintf(outparams, sizeof(outparams), "FL %s %s %d", + passport, passport, session->dest_group_id); + + session->moving_buddy = FALSE; + session->dest_group_id = 0; + + if (!msn_servconn_send_command(session->notification_conn, + "ADD", outparams)) { + hide_login_progress(gc, _("Write error")); + signoff(gc); + } + } + + return TRUE; +} + /************************************************************************** * Misc commands **************************************************************************/ @@ -1046,6 +1096,7 @@ if (notification_commands == NULL) { /* Register the command callbacks. */ msn_servconn_register_command(notification, "ADD", __add_cmd); + msn_servconn_register_command(notification, "ADG", __adg_cmd); msn_servconn_register_command(notification, "BLP", __blp_cmd); msn_servconn_register_command(notification, "BPR", __blank_cmd); msn_servconn_register_command(notification, "CHG", __blank_cmd); @@ -1064,7 +1115,8 @@ msn_servconn_register_command(notification, "QRY", __blank_cmd); msn_servconn_register_command(notification, "REA", __rea_cmd); msn_servconn_register_command(notification, "REG", __reg_cmd); - msn_servconn_register_command(notification, "REM", __blank_cmd); + msn_servconn_register_command(notification, "REM", __rem_cmd); + msn_servconn_register_command(notification, "RMG", __blank_cmd); msn_servconn_register_command(notification, "RNG", __rng_cmd); msn_servconn_register_command(notification, "SYN", __blank_cmd); msn_servconn_register_command(notification, "URL", __url_cmd);
