comparison src/protocols/silc/chat.c @ 9488:2770a0e659ca

[gaim-migrate @ 10313] Stu Tomlinson assures me that this is a bunch of new and fancy features for SILC that we really need. I believe him because his name is pronounceable backward. This is from Patch #975859, and additionally fixes bug #981066 and mitigates #981080. We love you, Stu. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Thu, 08 Jul 2004 18:45:01 +0000
parents 43741d8f76f7
children 578986136bac
comparison
equal deleted inserted replaced
9487:c23f7045357c 9488:2770a0e659ca
76 static void 76 static void
77 silcgaim_chat_getinfo(GaimConnection *gc, GHashTable *components) 77 silcgaim_chat_getinfo(GaimConnection *gc, GHashTable *components)
78 { 78 {
79 SilcGaim sg = gc->proto_data; 79 SilcGaim sg = gc->proto_data;
80 const char *chname; 80 const char *chname;
81 char *buf, tmp[256]; 81 char *buf, tmp[256], *tmp2;
82 GString *s; 82 GString *s;
83 SilcChannelEntry channel; 83 SilcChannelEntry channel;
84 SilcHashTableList htl; 84 SilcHashTableList htl;
85 SilcChannelUser chu; 85 SilcChannelUser chu;
86 86
99 components); 99 components);
100 return; 100 return;
101 } 101 }
102 102
103 s = g_string_new(""); 103 s = g_string_new("");
104 g_string_append_printf(s, _("Channel Name:\t\t%s\n"), channel->channel_name); 104 tmp2 = gaim_escape_html(channel->channel_name);
105 g_string_append_printf(s, _("<b>Channel Name:</b> %s"), tmp2);
106 g_free(tmp2);
105 if (channel->user_list && silc_hash_table_count(channel->user_list)) 107 if (channel->user_list && silc_hash_table_count(channel->user_list))
106 g_string_append_printf(s, _("User Count:\t\t%d\n"), 108 g_string_append_printf(s, _("<br><b>User Count:</b> %d"),
107 (int)silc_hash_table_count(channel->user_list)); 109 (int)silc_hash_table_count(channel->user_list));
108 110
109 silc_hash_table_list(channel->user_list, &htl); 111 silc_hash_table_list(channel->user_list, &htl);
110 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) { 112 while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
111 if (chu->mode & SILC_CHANNEL_UMODE_CHANFO) { 113 if (chu->mode & SILC_CHANNEL_UMODE_CHANFO) {
112 g_string_append_printf(s, _("Channel Founder:\t%s\n"), 114 tmp2 = gaim_escape_html(chu->client->nickname);
113 chu->client->nickname); 115 g_string_append_printf(s, _("<br><b>Channel Founder:</b> %s"),
116 tmp2);
117 g_free(tmp2);
114 break; 118 break;
115 } 119 }
116 } 120 }
117 silc_hash_table_list_reset(&htl); 121 silc_hash_table_list_reset(&htl);
118 122
119 if (channel->channel_key) 123 if (channel->channel_key)
120 g_string_append_printf(s, _("Channel Cipher:\t\t%s\n"), 124 g_string_append_printf(s, _("<br><b>Channel Cipher:</b> %s"),
121 silc_cipher_get_name(channel->channel_key)); 125 silc_cipher_get_name(channel->channel_key));
122 if (channel->hmac) 126 if (channel->hmac)
123 g_string_append_printf(s, _("Channel HMAC:\t\t%s\n"), 127 g_string_append_printf(s, _("<br><b>Channel HMAC:</b> %s"),
124 silc_hmac_get_name(channel->hmac)); 128 silc_hmac_get_name(channel->hmac));
125 129
126 if (channel->topic) 130 if (channel->topic) {
127 g_string_append_printf(s, _("\nChannel Topic:\n\t%s\n"), channel->topic); 131 tmp2 = gaim_escape_html(channel->topic);
132 g_string_append_printf(s, _("<br><b>Channel Topic:</b><br>%s"), tmp2);
133 g_free(tmp2);
134 }
128 135
129 if (channel->mode) { 136 if (channel->mode) {
130 g_string_append_printf(s, _("\nChannel Modes:\n")); 137 g_string_append_printf(s, _("<br><b>Channel Modes:</b> "));
131 silcgaim_get_chmode_string(channel->mode, tmp, sizeof(tmp)); 138 silcgaim_get_chmode_string(channel->mode, tmp, sizeof(tmp));
132 g_string_append_printf(s, tmp); 139 g_string_append_printf(s, tmp);
133 g_string_append_printf(s, "\n");
134 } 140 }
135 141
136 if (channel->founder_key) { 142 if (channel->founder_key) {
137 char *fingerprint, *babbleprint; 143 char *fingerprint, *babbleprint;
138 unsigned char *pk; 144 unsigned char *pk;
139 SilcUInt32 pk_len; 145 SilcUInt32 pk_len;
140 pk = silc_pkcs_public_key_encode(channel->founder_key, &pk_len); 146 pk = silc_pkcs_public_key_encode(channel->founder_key, &pk_len);
141 fingerprint = silc_hash_fingerprint(NULL, pk, pk_len); 147 fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
142 babbleprint = silc_hash_babbleprint(NULL, pk, pk_len); 148 babbleprint = silc_hash_babbleprint(NULL, pk, pk_len);
143 149
144 g_string_append_printf(s, _("\nFounder Key Fingerprint:\n%s\n\n"), fingerprint); 150 g_string_append_printf(s, _("<br><b>Founder Key Fingerprint:</b><br>%s"), fingerprint);
145 g_string_append_printf(s, _("Founder Key Babbleprint:\n%s"), babbleprint); 151 g_string_append_printf(s, _("<br><b>Founder Key Babbleprint:</b><br>%s"), babbleprint);
146 152
147 silc_free(fingerprint); 153 silc_free(fingerprint);
148 silc_free(babbleprint); 154 silc_free(babbleprint);
149 silc_free(pk); 155 silc_free(pk);
150 } 156 }
151 157
152 buf = g_string_free(s, FALSE); 158 buf = g_string_free(s, FALSE);
153 gaim_notify_message(NULL, GAIM_NOTIFY_MSG_INFO, 159 gaim_notify_formatted(gc, NULL, _("Channel Information"), NULL, buf, NULL, NULL);
154 _("Channel Information"),
155 _("Channel Information"),
156 buf, NULL, NULL);
157 g_free(buf); 160 g_free(buf);
158 } 161 }
159 162
160 163
161 static void 164 static void