Mercurial > pidgin
comparison src/protocols/silc/chat.c @ 9038:095731b5e4f6
[gaim-migrate @ 9814]
Hmm. there's still a compile warning, but at least it compiles now.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Sun, 23 May 2004 19:40:55 +0000 |
parents | 7ab20f829190 |
children | 1a446f2a1822 |
comparison
equal
deleted
inserted
replaced
9037:960bb3bd9ba6 | 9038:095731b5e4f6 |
---|---|
41 | 41 |
42 return ci; | 42 return ci; |
43 } | 43 } |
44 | 44 |
45 static void | 45 static void |
46 silcgaim_chat_getinfo(GaimBlistNode *node, gpointer data); | 46 silcgaim_chat_getinfo(GaimConnection *gc, GHashTable *components); |
47 | 47 |
48 static void | 48 static void |
49 silcgaim_chat_getinfo_res(SilcClient client, | 49 silcgaim_chat_getinfo_res(SilcClient client, |
50 SilcClientConnection conn, | 50 SilcClientConnection conn, |
51 SilcChannelEntry *channels, | 51 SilcChannelEntry *channels, |
70 } | 70 } |
71 | 71 |
72 silcgaim_chat_getinfo(gc, components); | 72 silcgaim_chat_getinfo(gc, components); |
73 } | 73 } |
74 | 74 |
75 static void | 75 |
76 silcgaim_chat_getinfo(GaimBlistNode *node, gpointer data) | 76 static void |
77 { | 77 silcgaim_chat_getinfo(GaimConnection *gc, GHashTable *components) |
78 GaimChat *chat; | 78 { |
79 GaimConnection *gc; | 79 SilcGaim sg = gc->proto_data; |
80 SilcGaim sg; | |
81 | |
82 const char *chname; | 80 const char *chname; |
83 char *buf, tmp[256]; | 81 char *buf, tmp[256]; |
84 GString *s; | 82 GString *s; |
85 SilcChannelEntry channel; | 83 SilcChannelEntry channel; |
86 SilcHashTableList htl; | 84 SilcHashTableList htl; |
87 SilcChannelUser chu; | 85 SilcChannelUser chu; |
88 | 86 |
89 g_return_if_fail(GAIM_BLIST_NODE_IS_CHAT(node)); | 87 if (!components) |
90 | 88 return; |
91 chat = (GaimChat *) node; | 89 |
92 gc = gaim_account_get_connection(chat->account); | 90 chname = g_hash_table_lookup(components, "channel"); |
93 sg = gc->proto_data; | |
94 | |
95 chname = g_hash_table_lookup(chat->components, "channel"); | |
96 if (!chname) | 91 if (!chname) |
97 return; | 92 return; |
98 channel = silc_client_get_channel(sg->client, sg->conn, | 93 channel = silc_client_get_channel(sg->client, sg->conn, |
99 (char *)chname); | 94 (char *)chname); |
100 if (!channel) { | 95 if (!channel) { |
101 silc_client_get_channel_resolve(sg->client, sg->conn, | 96 silc_client_get_channel_resolve(sg->client, sg->conn, |
102 (char *)chname, | 97 (char *)chname, |
103 silcgaim_chat_getinfo_res, | 98 silcgaim_chat_getinfo_res, |
104 chat->components); | 99 components); |
105 return; | 100 return; |
106 } | 101 } |
107 | 102 |
108 s = g_string_new(""); | 103 s = g_string_new(""); |
109 g_string_append_printf(s, "Channel Name:\t\t%s\n", channel->channel_name); | 104 g_string_append_printf(s, "Channel Name:\t\t%s\n", channel->channel_name); |
158 gaim_notify_message(NULL, GAIM_NOTIFY_MSG_INFO, | 153 gaim_notify_message(NULL, GAIM_NOTIFY_MSG_INFO, |
159 _("Channel Information"), | 154 _("Channel Information"), |
160 _("Channel Information"), | 155 _("Channel Information"), |
161 buf, NULL, NULL); | 156 buf, NULL, NULL); |
162 g_free(buf); | 157 g_free(buf); |
158 } | |
159 | |
160 | |
161 static void | |
162 silcgaim_chat_getinfo_menu(GaimBlistNode *node, gpointer data) | |
163 { | |
164 | |
163 } | 165 } |
164 | 166 |
165 | 167 |
166 #if 0 /* XXX For now these are not implemented. We need better | 168 #if 0 /* XXX For now these are not implemented. We need better |
167 listview dialog from Gaim for these. */ | 169 listview dialog from Gaim for these. */ |
816 "+s", NULL); | 818 "+s", NULL); |
817 } | 819 } |
818 | 820 |
819 GList *silcgaim_chat_menu(GaimChat *chat) | 821 GList *silcgaim_chat_menu(GaimChat *chat) |
820 { | 822 { |
821 GHashTable components = chat->components; | 823 GHashTable *components = chat->components; |
822 GaimConnection *gc = gaim_account_get_connection(chat->account); | 824 GaimConnection *gc = gaim_account_get_connection(chat->account); |
823 SilcGaim sg = gc->proto_data; | 825 SilcGaim sg = gc->proto_data; |
824 SilcClientConnection conn = sg->conn; | 826 SilcClientConnection conn = sg->conn; |
825 const char *chname = NULL; | 827 const char *chname = NULL; |
826 SilcChannelEntry channel = NULL; | 828 SilcChannelEntry channel = NULL; |
827 SilcChannelUser chu = NULL; | 829 SilcChannelUser chu = NULL; |
828 SilcUInt32 mode = 0; | 830 SilcUInt32 mode = 0; |
829 | 831 |
830 GList *m; | 832 GList *m = NULL; |
831 GaimBlistNodeAction *act; | 833 GaimBlistNodeAction *act; |
832 | 834 |
833 if (components) | 835 if (components) |
834 chname = g_hash_table_lookup(components, "channel"); | 836 chname = g_hash_table_lookup(components, "channel"); |
835 if (chname) | 837 if (chname) |
843 | 845 |
844 if (strstr(chname, "[Private Group]")) | 846 if (strstr(chname, "[Private Group]")) |
845 return NULL; | 847 return NULL; |
846 | 848 |
847 act = gaim_blist_node_action_new(_("Get Info"), | 849 act = gaim_blist_node_action_new(_("Get Info"), |
848 silcgaim_chat_getinfo, NULL); | 850 silcgaim_chat_getinfo_menu, NULL); |
849 m = g_list_append(m, act); | 851 m = g_list_append(m, act); |
850 | 852 |
851 #if 0 /* XXX For now these are not implemented. We need better | 853 #if 0 /* XXX For now these are not implemented. We need better |
852 listview dialog from Gaim for these. */ | 854 listview dialog from Gaim for these. */ |
853 if (mode & SILC_CHANNEL_UMODE_CHANOP) { | 855 if (mode & SILC_CHANNEL_UMODE_CHANOP) { |