comparison libgaim/protocols/qq/group.c @ 14404:8ff8f1c897b5

[gaim-migrate @ 17112] Fixed chat support. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Fri, 01 Sep 2006 11:03:18 +0000
parents 60b1bc8dbf37
children 6b8bc59414f0
comparison
equal deleted inserted replaced
14403:646dcf11b4eb 14404:8ff8f1c897b5
24 24
25 #include "debug.h" 25 #include "debug.h"
26 #include "prpl.h" 26 #include "prpl.h"
27 #include "request.h" 27 #include "request.h"
28 28
29 #include "group_hash.h" 29 #include "group_internal.h"
30 #include "group_info.h" 30 #include "group_info.h"
31 #include "group_search.h" 31 #include "group_search.h"
32 #include "utils.h" 32 #include "utils.h"
33 33
34 #include "group.h" 34 #include "group.h"
41 external_group_id = qq_string_to_dec_value(input); 41 external_group_id = qq_string_to_dec_value(input);
42 /* 0x00000000 means search for demo group */ 42 /* 0x00000000 means search for demo group */
43 qq_send_cmd_group_search_group(gc, external_group_id); 43 qq_send_cmd_group_search_group(gc, external_group_id);
44 } 44 }
45 45
46 static void _qq_group_search_cancel_callback(GaimConnection *gc, const gchar *input)
47 {
48 qq_data *qd;
49 g_return_if_fail(gc != NULL && gc->proto_data != NULL);
50
51 qd = (qq_data *) gc->proto_data;
52 gaim_roomlist_set_in_progress(qd->roomlist, FALSE);
53 }
54
46 /* This is needed for GaimChat node to be valid */ 55 /* This is needed for GaimChat node to be valid */
47 GList *qq_chat_info(GaimConnection *gc) 56 GList *qq_chat_info(GaimConnection *gc)
48 { 57 {
49 GList *m; 58 GList *m;
50 struct proto_chat_entry *pce; 59 struct proto_chat_entry *pce;
53 62
54 pce = g_new0(struct proto_chat_entry, 1); 63 pce = g_new0(struct proto_chat_entry, 1);
55 pce->label = _("ID: "); 64 pce->label = _("ID: ");
56 pce->identifier = QQ_GROUP_KEY_EXTERNAL_ID; 65 pce->identifier = QQ_GROUP_KEY_EXTERNAL_ID;
57 m = g_list_append(m, pce); 66 m = g_list_append(m, pce);
67
68 return m;
69 }
58 70
59 pce = g_new0(struct proto_chat_entry, 1); 71 GHashTable *qq_chat_info_defaults(GaimConnection *gc, const gchar *chat_name)
60 pce->label = _("Admin: "); 72 {
61 pce->identifier = QQ_GROUP_KEY_CREATOR_UID; 73 GHashTable *defaults;
62 m = g_list_append(m, pce);
63 74
64 pce = g_new0(struct proto_chat_entry, 1); 75 defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free);
65 pce->label = _("Status: ");
66 pce->identifier = QQ_GROUP_KEY_MEMBER_STATUS_DESC;
67 m = g_list_append(m, pce);
68 76
69 return m; 77 if (chat_name != NULL)
78 g_hash_table_insert(defaults, QQ_GROUP_KEY_EXTERNAL_ID, g_strdup(chat_name));
79
80 return defaults;
70 } 81 }
71 82
72 /* get a list of qq groups */ 83 /* get a list of qq groups */
73 GaimRoomlist *qq_roomlist_get_list(GaimConnection *gc) 84 GaimRoomlist *qq_roomlist_get_list(GaimConnection *gc)
74 { 85 {
105 gaim_roomlist_set_fields(rl, fields); 116 gaim_roomlist_set_fields(rl, fields);
106 gaim_roomlist_set_in_progress(qd->roomlist, TRUE); 117 gaim_roomlist_set_in_progress(qd->roomlist, TRUE);
107 118
108 gaim_request_input(gc, _("QQ Qun"), 119 gaim_request_input(gc, _("QQ Qun"),
109 _("Please input external group ID"), 120 _("Please input external group ID"),
110 _("You can only search for permanent QQ group\nInput 0 or leave it blank to search for demo groups"), 121 _("You can only search for permanent QQ groups\n"),
111 NULL, FALSE, FALSE, NULL, _("Search"), 122 NULL, FALSE, FALSE, NULL,
112 G_CALLBACK(_qq_group_search_callback), _("Cancel"), NULL, gc); 123 _("Search"), G_CALLBACK(_qq_group_search_callback),
124 _("Cancel"), G_CALLBACK(_qq_group_search_cancel_callback),
125 gc);
113 126
114 return qd->roomlist; 127 return qd->roomlist;
115 } 128 }
116 129
117 /* free roomlist space, I have no idea when this one is called ... */ 130 /* free roomlist space, I have no idea when this one is called ... */