Mercurial > pidgin
comparison src/protocols/toc/toc.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 | 1e28e7d802a1 |
comparison
equal
deleted
inserted
replaced
| 4769:e0afac5f85bd | 4770:c4c28874ecd3 |
|---|---|
| 54 | 54 |
| 55 static struct prpl *my_protocol = NULL; | 55 static struct prpl *my_protocol = NULL; |
| 56 | 56 |
| 57 /* for win32 compatability */ | 57 /* for win32 compatability */ |
| 58 G_MODULE_IMPORT GSList *connections; | 58 G_MODULE_IMPORT GSList *connections; |
| 59 G_MODULE_IMPORT GSList *groups; | |
| 60 | 59 |
| 61 #define REVISION "penguin" | 60 #define REVISION "penguin" |
| 62 | 61 |
| 63 #define TYPE_SIGNON 1 | 62 #define TYPE_SIGNON 1 |
| 64 #define TYPE_DATA 2 | 63 #define TYPE_DATA 2 |
| 266 g_free(gc->proto_data); | 265 g_free(gc->proto_data); |
| 267 } | 266 } |
| 268 | 267 |
| 269 static void toc_build_config(struct gaim_account *account, char *s, int len, gboolean show) | 268 static void toc_build_config(struct gaim_account *account, char *s, int len, gboolean show) |
| 270 { | 269 { |
| 271 GSList *grp = groups; | 270 GSList *grp = gaim_blist_groups(); |
| 272 GSList *mem; | 271 GSList *grp1 = grp; |
| 272 GSList *mem, *mem1; | |
| 273 struct group *g; | 273 struct group *g; |
| 274 struct buddy *b; | 274 struct buddy *b; |
| 275 GSList *plist = account->permit; | 275 GSList *plist = account->permit; |
| 276 GSList *dlist = account->deny; | 276 GSList *dlist = account->deny; |
| 277 | 277 |
| 279 | 279 |
| 280 if (!account->permdeny) | 280 if (!account->permdeny) |
| 281 account->permdeny = 1; | 281 account->permdeny = 1; |
| 282 | 282 |
| 283 pos += g_snprintf(&s[pos], len - pos, "m %d\n", account->permdeny); | 283 pos += g_snprintf(&s[pos], len - pos, "m %d\n", account->permdeny); |
| 284 while (len > pos && grp) { | 284 while (len > pos && grp1) { |
| 285 g = (struct group *)grp->data; | 285 g = (struct group *)grp1->data; |
| 286 if(gaim_group_on_account(g, account)) { | 286 if(gaim_group_on_account(g, account)) { |
| 287 pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name); | 287 pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name); |
| 288 mem = g->members; | 288 mem = gaim_blist_members(g); |
| 289 while (len > pos && mem) { | 289 mem1 = mem; |
| 290 b = (struct buddy *)mem->data; | 290 while (len > pos && mem1) { |
| 291 b = (struct buddy *)mem1->data; | |
| 291 if(b->account == account) { | 292 if(b->account == account) { |
| 292 pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name, | 293 pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name, |
| 293 (show && b->alias) ? ":" : "", | 294 (show && b->alias) ? ":" : "", |
| 294 (show && b->alias) ? b->alias : ""); | 295 (show && b->alias) ? b->alias : ""); |
| 295 } | 296 } |
| 296 mem = mem->next; | 297 mem1 = mem1->next; |
| 297 } | 298 } |
| 299 g_slist_free(mem); | |
| 298 } | 300 } |
| 299 grp = g_slist_next(grp); | 301 grp1 = g_slist_next(grp1); |
| 300 } | 302 } |
| 303 g_slist_free(grp); | |
| 301 | 304 |
| 302 while (len > pos && plist) { | 305 while (len > pos && plist) { |
| 303 pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data); | 306 pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data); |
| 304 plist = plist->next; | 307 plist = plist->next; |
| 305 } | 308 } |
