Mercurial > pidgin
comparison src/protocols/yahoo/yahoochat.c @ 8584:058efd3cb86f
[gaim-migrate @ 9334]
" This is definitely not the most critical fix, but every
time i see the text "catagory" my eyes bleed a little bit.
This should remedy this unnecessary loss of blood -
hopefully this way i can make my visits to the Red
Cross more frequent." --Daniel Atallah
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Mon, 05 Apr 2004 17:33:34 +0000 |
parents | 3c07b7d0084c |
children | 92cbf9713795 |
comparison
equal
deleted
inserted
replaced
8583:fc27237783ee | 8584:058efd3cb86f |
---|---|
1125 } | 1125 } |
1126 if (!name || !id) | 1126 if (!name || !id) |
1127 return; | 1127 return; |
1128 | 1128 |
1129 parent = g_queue_peek_head(s->q); | 1129 parent = g_queue_peek_head(s->q); |
1130 r = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_CATAGORY, name, parent); | 1130 r = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_CATEGORY, name, parent); |
1131 gaim_roomlist_room_add_field(list, r, (gpointer)name); | 1131 gaim_roomlist_room_add_field(list, r, (gpointer)name); |
1132 gaim_roomlist_room_add_field(list, r, (gpointer)id); | 1132 gaim_roomlist_room_add_field(list, r, (gpointer)id); |
1133 gaim_roomlist_room_add(list, r); | 1133 gaim_roomlist_room_add(list, r); |
1134 g_queue_push_head(s->q, r); | 1134 g_queue_push_head(s->q, r); |
1135 } else if (!strcmp(ename, "room")) { | 1135 } else if (!strcmp(ename, "room")) { |
1186 } else if (!strcmp(ename, "room")) { | 1186 } else if (!strcmp(ename, "room")) { |
1187 struct yahoo_lobby *lob; | 1187 struct yahoo_lobby *lob; |
1188 GaimRoomlistRoom *r, *l; | 1188 GaimRoomlistRoom *r, *l; |
1189 | 1189 |
1190 if (s->room.type == yrt_yahoo) | 1190 if (s->room.type == yrt_yahoo) |
1191 r = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_CATAGORY|GAIM_ROOMLIST_ROOMTYPE_ROOM, | 1191 r = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_CATEGORY|GAIM_ROOMLIST_ROOMTYPE_ROOM, |
1192 s->room.name, s->yrl->cat); | 1192 s->room.name, s->yrl->cat); |
1193 else | 1193 else |
1194 r = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_CATAGORY|GAIM_ROOMLIST_ROOMTYPE_ROOM, | 1194 r = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_CATEGORY|GAIM_ROOMLIST_ROOMTYPE_ROOM, |
1195 s->room.name, s->yrl->ucat); | 1195 s->room.name, s->yrl->ucat); |
1196 | 1196 |
1197 gaim_roomlist_room_add_field(s->list, r, s->room.name); | 1197 gaim_roomlist_room_add_field(s->list, r, s->room.name); |
1198 gaim_roomlist_room_add_field(s->list, r, s->room.id); | 1198 gaim_roomlist_room_add_field(s->list, r, s->room.id); |
1199 gaim_roomlist_room_add_field(s->list, r, GINT_TO_POINTER(s->room.users)); | 1199 gaim_roomlist_room_add_field(s->list, r, GINT_TO_POINTER(s->room.users)); |
1382 gaim_roomlist_unref(l->data); | 1382 gaim_roomlist_unref(l->data); |
1383 } | 1383 } |
1384 g_list_free(k); | 1384 g_list_free(k); |
1385 } | 1385 } |
1386 | 1386 |
1387 void yahoo_roomlist_expand_catagory(GaimRoomlist *list, GaimRoomlistRoom *catagory) | 1387 void yahoo_roomlist_expand_category(GaimRoomlist *list, GaimRoomlistRoom *category) |
1388 { | 1388 { |
1389 struct yahoo_roomlist *yrl; | 1389 struct yahoo_roomlist *yrl; |
1390 char *url; | 1390 char *url; |
1391 char *id; | 1391 char *id; |
1392 | 1392 |
1393 if (catagory->type != GAIM_ROOMLIST_ROOMTYPE_CATAGORY) | 1393 if (category->type != GAIM_ROOMLIST_ROOMTYPE_CATEGORY) |
1394 return; | 1394 return; |
1395 | 1395 |
1396 if (!(id = g_list_nth_data(catagory->fields, 1))) { | 1396 if (!(id = g_list_nth_data(category->fields, 1))) { |
1397 gaim_roomlist_set_in_progress(list, FALSE); | 1397 gaim_roomlist_set_in_progress(list, FALSE); |
1398 return; | 1398 return; |
1399 } | 1399 } |
1400 | 1400 |
1401 url = g_strdup_printf("%s?chatroom_%s=0", | 1401 url = g_strdup_printf("%s?chatroom_%s=0", |
1403 list->account, | 1403 list->account, |
1404 "room_list", YAHOO_ROOMLIST_URL), id); | 1404 "room_list", YAHOO_ROOMLIST_URL), id); |
1405 | 1405 |
1406 yrl = g_new0(struct yahoo_roomlist, 1); | 1406 yrl = g_new0(struct yahoo_roomlist, 1); |
1407 yrl->list = list; | 1407 yrl->list = list; |
1408 yrl->cat = catagory; | 1408 yrl->cat = category; |
1409 list->proto_data = g_list_append(list->proto_data, yrl); | 1409 list->proto_data = g_list_append(list->proto_data, yrl); |
1410 | 1410 |
1411 gaim_url_parse(url, &(yrl->host), NULL, &(yrl->path)); | 1411 gaim_url_parse(url, &(yrl->host), NULL, &(yrl->path)); |
1412 g_free(url); | 1412 g_free(url); |
1413 | 1413 |
1414 yrl->ucat = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_CATAGORY, _("User Rooms"), yrl->cat); | 1414 yrl->ucat = gaim_roomlist_room_new(GAIM_ROOMLIST_ROOMTYPE_CATEGORY, _("User Rooms"), yrl->cat); |
1415 gaim_roomlist_room_add(list, yrl->ucat); | 1415 gaim_roomlist_room_add(list, yrl->ucat); |
1416 | 1416 |
1417 if (gaim_proxy_connect(list->account, | 1417 if (gaim_proxy_connect(list->account, |
1418 yrl->host, 80, yahoo_roomlist_got_connected, yrl) != 0) | 1418 yrl->host, 80, yahoo_roomlist_got_connected, yrl) != 0) |
1419 { | 1419 { |