comparison src/protocols/gg/gg.c @ 4770:c4c28874ecd3

[gaim-migrate @ 5088] I want to go to sleep. This is drag-n-drop moving of buddies in the list. I think it works, but I didn't actually test it... I really should have though; I can't imagine it working fine as-is. ;) I'm holding off on the rest of my Edit Buddy List stuff for tomorrow... I love last minute things, don't I? Note: I created gaim_blist_members and gaim_blist_groups to reproduce the effects of the old groups GSList and the members GSList of the group struct that I removed. This is really sub-optimal and should be replaced to iterate the Buddy List directly. If someone wants to do that, please do. Even if you don't want to do that, just review the changes I made and make sure I didn't do anything stupid. It is past 6am and I'm a bit tired and prone to mistake making. Thanks. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Fri, 14 Mar 2003 11:38:21 +0000
parents c15e0699acae
children 92ae181271e9
comparison
equal deleted inserted replaced
4769:e0afac5f85bd 4770:c4c28874ecd3
1 /* 1 /*
2 * gaim - Gadu-Gadu Protocol Plugin 2 * gaim - Gadu-Gadu Protocol Plugin
3 * $Id: gg.c 5047 2003-03-13 06:08:56Z faceprint $ 3 * $Id: gg.c 5088 2003-03-14 11:38:21Z seanegan $
4 * 4 *
5 * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL> 5 * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
83 83
84 #define UC_NORMAL 2 84 #define UC_NORMAL 2
85 85
86 /* for win32 compatability */ 86 /* for win32 compatability */
87 G_MODULE_IMPORT GSList *connections; 87 G_MODULE_IMPORT GSList *connections;
88 G_MODULE_IMPORT GSList *groups;
89 88
90 struct agg_data { 89 struct agg_data {
91 struct gg_session *sess; 90 struct gg_session *sess;
92 int own_status; 91 int own_status;
93 }; 92 };
1003 struct agg_http *he = g_new0(struct agg_http, 1); 1002 struct agg_http *he = g_new0(struct agg_http, 1);
1004 gchar *ptr; 1003 gchar *ptr;
1005 gchar *u = gg_urlencode(gc->username); 1004 gchar *u = gg_urlencode(gc->username);
1006 gchar *p = gg_urlencode(gc->password); 1005 gchar *p = gg_urlencode(gc->password);
1007 1006
1008 GSList *gr = groups; 1007 GSList *gr = gaim_blist_groups();
1008 GSList *gr1 = gr;
1009 1009
1010 he->gc = gc; 1010 he->gc = gc;
1011 he->type = AGG_HTTP_USERLIST_EXPORT; 1011 he->type = AGG_HTTP_USERLIST_EXPORT;
1012 he->form = AGG_PUBDIR_USERLIST_EXPORT_FORM; 1012 he->form = AGG_PUBDIR_USERLIST_EXPORT_FORM;
1013 he->host = GG_PUBDIR_HOST; 1013 he->host = GG_PUBDIR_HOST;
1014 he->request = g_strdup_printf("FmNum=%s&Pass=%s&Contacts=", u, p); 1014 he->request = g_strdup_printf("FmNum=%s&Pass=%s&Contacts=", u, p);
1015 1015
1016 g_free(u); 1016 g_free(u);
1017 g_free(p); 1017 g_free(p);
1018 1018
1019 while (gr) { 1019 while (gr1) {
1020 struct group *g = gr->data; 1020 struct group *g = gr1->data;
1021 GSList *m = g->members; 1021 GSList *m = gaim_blist_members(g);
1022 GSList *m1 = m;
1022 int num_added=0; 1023 int num_added=0;
1023 while (m) { 1024 while (m1) {
1024 struct buddy *b = m->data; 1025 struct buddy *b = m1->data;
1025 1026
1026 if(b->account == gc->account) { 1027 if(b->account == gc->account) {
1027 gchar *newdata; 1028 gchar *newdata;
1028 /* GG Number */ 1029 /* GG Number */
1029 gchar *name = gg_urlencode(b->name); 1030 gchar *name = gg_urlencode(b->name);
1048 1049
1049 g_free(gname); 1050 g_free(gname);
1050 g_free(show); 1051 g_free(show);
1051 g_free(name); 1052 g_free(name);
1052 } 1053 }
1053 m = g_slist_next(m); 1054 m1 = g_slist_next(m1);
1054 } 1055 }
1055 gr = g_slist_next(gr); 1056 g_slist_free(m);
1056 } 1057 gr = g_slist_next(gr1);
1058 }
1059 g_slist_free(gr);
1057 1060
1058 if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) { 1061 if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) {
1059 do_error_dialog(_("Couldn't export buddy list"), 1062 do_error_dialog(_("Couldn't export buddy list"),
1060 _("Gaim was unable to connect to the buddy list server. " 1063 _("Gaim was unable to connect to the buddy list server. "
1061 "Please try again later."), GAIM_ERROR); 1064 "Please try again later."), GAIM_ERROR);