comparison src/protocols/zephyr/zephyr.c @ 8568:88988327a4e0

[gaim-migrate @ 9316] Remove the get_away prpl function. Nada used it. Pink elephants on parade. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 03 Apr 2004 01:33:45 +0000
parents e3c059c3d92d
children 5af95c2b1179
comparison
equal deleted inserted replaced
8567:d92a7574473c 8568:88988327a4e0
125 g_free(zt->name); 125 g_free(zt->name);
126 g_free(zt); 126 g_free(zt);
127 } 127 }
128 128
129 static const char* gaim_zephyr_get_sender() { 129 static const char* gaim_zephyr_get_sender() {
130 /* will be useful once this plugin can use a backend other 130 /* will be useful once this plugin can use a backend other
131 than libzephyr */ 131 than libzephyr */
132 return ZGetSender(); 132 return ZGetSender();
133 } 133 }
134 134
135 static const char* gaim_zephyr_get_realm() { 135 static const char* gaim_zephyr_get_realm() {
136 /* will be useful once this plugin can use a backend other 136 /* will be useful once this plugin can use a backend other
137 than libzephyr */ 137 than libzephyr */
138 return ZGetRealm(); 138 return ZGetRealm();
139 } 139 }
140 140
141 /* returns true if zt1 is a subset of zt2, i.e. zt2 has the same thing or 141 /* returns true if zt1 is a subset of zt2, i.e. zt2 has the same thing or
142 * wildcards in each field of zt1. */ 142 * wildcards in each field of zt1. */
143 static gboolean triple_subset(zephyr_triple *zt1, zephyr_triple *zt2) 143 static gboolean triple_subset(zephyr_triple *zt1, zephyr_triple *zt2)
186 static gchar *zephyr_recv_convert(char *string, int len) 186 static gchar *zephyr_recv_convert(char *string, int len)
187 { 187 {
188 gchar *utf8; 188 gchar *utf8;
189 GError *err = NULL; 189 GError *err = NULL;
190 if (g_utf8_validate(string,len,NULL)) { 190 if (g_utf8_validate(string,len,NULL)) {
191 return g_strdup(string); 191 return g_strdup(string);
192 } else { 192 } else {
193 utf8 = g_convert(string, len, "UTF-8", 193 utf8 = g_convert(string, len, "UTF-8",
194 gaim_account_get_string(zgc->account, "encoding", ZEPHYR_FALLBACK_CHARSET), 194 gaim_account_get_string(zgc->account, "encoding", ZEPHYR_FALLBACK_CHARSET),
195 NULL, NULL, &err); 195 NULL, NULL, &err);
196 if (err) { 196 if (err) {
197 gaim_debug(GAIM_DEBUG_ERROR, "zephyr", "recv conversion error: %s\n", err->message); 197 gaim_debug(GAIM_DEBUG_ERROR, "zephyr", "recv conversion error: %s\n", err->message);
198 utf8 = g_strdup(_("(There was an error converting this message. Check the 'Encoding' option in the Account Editor)")); 198 utf8 = g_strdup(_("(There was an error converting this message. Check the 'Encoding' option in the Account Editor)"));
199 } 199 }
200 200
201 return utf8; 201 return utf8;
202 } 202 }
203 } 203 }
204 204
205 /* utility macros that are useful for zephyr_to_html */ 205 /* utility macros that are useful for zephyr_to_html */
206 206
207 #define IS_OPENER(c) ((c == '{') || (c == '[') || (c == '(') || (c == '<')) 207 #define IS_OPENER(c) ((c == '{') || (c == '[') || (c == '(') || (c == '<'))
416 cnt++; /* point to char after closer */ 416 cnt++; /* point to char after closer */
417 g_string_append_c(new_f->text, '>'); 417 g_string_append_c(new_f->text, '>');
418 new_f->closing = "</font>"; 418 new_f->closing = "</font>";
419 new_f->has_closer = FALSE; 419 new_f->has_closer = FALSE;
420 frames = new_f; 420 frames = new_f;
421 421 } else if (!g_ascii_strcasecmp(buf, "color")) {
422 } else if (!g_ascii_strcasecmp(buf, "color")) {
423 cnt += end+1; 422 cnt += end+1;
424 new_f = g_new(zframe, 1); 423 new_f = g_new(zframe, 1);
425 new_f->enclosing = frames; 424 new_f->enclosing = frames;
426 new_f->text = g_string_new("<font color="); 425 new_f->text = g_string_new("<font color=");
427 for (; (cnt <= len) && !IS_CLOSER(message[cnt]); cnt++) { 426 for (; (cnt <= len) && !IS_CLOSER(message[cnt]); cnt++) {
1346 NULL, 1345 NULL,
1347 NULL, 1346 NULL,
1348 NULL, 1347 NULL,
1349 NULL, 1348 NULL,
1350 NULL, 1349 NULL,
1351 NULL,
1352 zephyr_add_buddy, 1350 zephyr_add_buddy,
1353 zephyr_add_buddies, 1351 zephyr_add_buddies,
1354 zephyr_remove_buddy, 1352 zephyr_remove_buddy,
1355 zephyr_remove_buddies, 1353 zephyr_remove_buddies,
1356 NULL, 1354 NULL,
1358 NULL, 1356 NULL,
1359 NULL, 1357 NULL,
1360 NULL, 1358 NULL,
1361 NULL, 1359 NULL,
1362 zephyr_join_chat, 1360 zephyr_join_chat,
1363 NULL, /* reject chat invite */ 1361 NULL, /* reject chat invite */
1364 NULL, 1362 NULL,
1365 zephyr_chat_leave, 1363 zephyr_chat_leave,
1366 NULL, 1364 NULL,
1367 zephyr_chat_send, 1365 zephyr_chat_send,
1368 NULL, 1366 NULL,
1371 NULL, 1369 NULL,
1372 NULL, 1370 NULL,
1373 NULL, 1371 NULL,
1374 NULL, 1372 NULL,
1375 NULL, 1373 NULL,
1376 NULL, 1374 NULL,
1377 zephyr_normalize, 1375 zephyr_normalize,
1378 NULL, 1376 NULL,
1379 NULL, 1377 NULL,
1380 NULL, 1378 NULL,
1381 zephyr_chat_set_topic 1379 zephyr_chat_set_topic
1382 }; 1380 };
1383 1381
1384 static GaimPluginInfo info = 1382 static GaimPluginInfo info =
1385 { 1383 {
1386 2, /**< api_version */ 1384 2, /**< api_version */
1417 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); 1415 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option);
1418 1416
1419 option = gaim_account_option_bool_new(_("Export to .zephyr.subs"),"write_zsubs",FALSE); 1417 option = gaim_account_option_bool_new(_("Export to .zephyr.subs"),"write_zsubs",FALSE);
1420 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); 1418 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option);
1421 1419
1422 option = gaim_account_option_string_new(_("Exposure"),"exposure_level",tmp?tmp:EXPOSE_REALMVIS); 1420 option = gaim_account_option_string_new(_("Exposure"),"exposure_level",tmp?tmp:EXPOSE_REALMVIS);
1423 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); 1421 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option);
1424 1422
1425 option = gaim_account_option_string_new(_("Encoding"),"encoding",ZEPHYR_FALLBACK_CHARSET); 1423 option = gaim_account_option_string_new(_("Encoding"),"encoding",ZEPHYR_FALLBACK_CHARSET);
1426 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option); 1424 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,option);
1427 1425
1428 my_protocol = plugin; 1426 my_protocol = plugin;
1429 } 1427 }
1430 1428
1431 GAIM_INIT_PLUGIN(zephyr, init_plugin, info); 1429 GAIM_INIT_PLUGIN(zephyr, init_plugin, info);