Mercurial > pidgin-twitter
changeset 200:9a2d727f39b4
removed jisko support as a protest to their expulsion policy.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Mon, 11 Aug 2008 14:31:54 +0900 |
parents | 5ddf8bee768d |
children | 0aeeafe37ef7 |
files | pidgin-twitter.c pidgin-twitter.h prefs.ui |
diffstat | 3 files changed, 100 insertions(+), 321 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin-twitter.c Mon Aug 11 10:17:46 2008 +0900 +++ b/pidgin-twitter.c Mon Aug 11 14:31:54 2008 +0900 @@ -24,8 +24,8 @@ /***********/ /* globals */ /***********/ -#define NUM_REGPS 12 -#define NUM_SERVICES 4 /* twitter, wassr, identica, jisko. */ +#define NUM_REGPS 11 +#define NUM_SERVICES 3 /* twitter, wassr, identica. */ static GRegex *regp[NUM_REGPS]; static gboolean suppress_oops = FALSE; static GHashTable *icon_hash[NUM_SERVICES]; @@ -849,9 +849,6 @@ case identica_service: format = RECIPIENT_FORMAT_IDENTICA; break; - case jisko_service: - format = RECIPIENT_FORMAT_JISKO; - break; default: twitter_debug("unknown service\n"); break; @@ -874,9 +871,6 @@ case identica_service: format = SENDER_FORMAT_IDENTICA; break; - case jisko_service: - format = SENDER_FORMAT_JISKO; - break; default: twitter_debug("unknown service\n"); break; @@ -1003,9 +997,6 @@ case identica_service: screen_name = purple_prefs_get_string(OPT_SCREEN_NAME_IDENTICA); break; - case jisko_service: - screen_name = purple_prefs_get_string(OPT_SCREEN_NAME_JISKO); - break; } if (screen_name) { @@ -1088,18 +1079,6 @@ markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>", bytes <= 140 ? "black" : "red", bytes); break; - case jisko_service: - gtk_text_buffer_get_start_iter(textbuffer, &head); - gtk_text_buffer_get_end_iter(textbuffer, &tail); - - text = gtk_text_buffer_get_text(textbuffer, &head, &tail, TRUE); - if(text) - bytes = strlen(text) + new_text_length; - g_free(text); - markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>", - bytes >= 5 && bytes <= 140 ? - "black" : "red", bytes); - break; default: twitter_debug("unknown service\n"); break; @@ -1163,26 +1142,6 @@ markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>", bytes <= 140 ? "black" : "red", bytes); break; - case jisko_service: - gtk_text_buffer_get_start_iter(textbuffer, &head); - gtk_text_buffer_get_end_iter(textbuffer, &tail); - - text = gtk_text_buffer_get_text(textbuffer, - &head, &tail, TRUE); - if(text) - bytes = strlen(text); - g_free(text); - - text = gtk_text_buffer_get_text(textbuffer, - start_pos, end_pos, TRUE); - if(text) - bytes -= strlen(text); - g_free(text); - - markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>", - bytes >= 5 && bytes <= 140 ? - "black" : "red", bytes); - break; default: twitter_debug("unknown service\n"); break; @@ -1211,7 +1170,6 @@ case twitter_service: case wassr_service: case identica_service: - case jisko_service: detach_from_conv(conv, NULL); break; default: @@ -1323,7 +1281,6 @@ case twitter_service: case wassr_service: case identica_service: - case jisko_service: attach_to_conv(conv, NULL); break; default: @@ -1465,30 +1422,6 @@ return is_identica_account(account, name); } -static gboolean -is_jisko_account(PurpleAccount *account, const char *name) -{ - const gchar *proto = purple_account_get_protocol_id(account); - - if(g_strstr_len(name, 16, "bot@jisko.net") && - g_strstr_len(proto, 11, "prpl-jabber")) { - return TRUE; - } - - return FALSE; -} - -static gboolean -is_jisko_conv(PurpleConversation *conv) -{ - g_return_val_if_fail(conv != NULL, FALSE); - - const char *name = purple_conversation_get_name(conv); - PurpleAccount *account = purple_conversation_get_account(conv); - - return is_jisko_account(account, name); -} - static gint get_service_type(PurpleConversation *conv) { @@ -1502,8 +1435,6 @@ service = wassr_service; else if(is_identica_conv(conv)) service = identica_service; - else if(is_jisko_conv(conv)) - service = jisko_service; return service; } @@ -1530,7 +1461,6 @@ break; case wassr_service: case identica_service: - case jisko_service: attach_to_conv(conv, NULL); break; default: @@ -1567,9 +1497,6 @@ case identica_service: hash = icon_hash[identica_service]; break; - case jisko_service: - hash = icon_hash[jisko_service]; - break; default: twitter_debug("unknown service\n"); break; @@ -1707,9 +1634,6 @@ case identica_service: hash = icon_hash[identica_service]; break; - case jisko_service: - hash = icon_hash[jisko_service]; - break; default: twitter_debug("unknown service\n"); } @@ -1756,9 +1680,6 @@ case identica_service: hash = icon_hash[identica_service]; break; - case jisko_service: - hash = icon_hash[jisko_service]; - break; default: twitter_debug("unknown service\n"); break; @@ -1817,11 +1738,6 @@ icon_hash[identica_service], user_name); regp_id = IMAGE_IDENTICA; } - else if(service == jisko_service) { - data = (icon_data *)g_hash_table_lookup( - icon_hash[jisko_service], user_name); - regp_id = IMAGE_JISKO; - } if(!url_text) { if(data) { @@ -1984,9 +1900,6 @@ case identica_service: hash = icon_hash[identica_service]; break; - case jisko_service: - hash = icon_hash[jisko_service]; - break; default: twitter_debug("unknown service\n"); } @@ -2058,9 +1971,6 @@ case identica_service: suffix = "identica"; break; - case jisko_service: - suffix = "jisko"; - break; default: twitter_debug("unknown service\n"); break; @@ -2125,10 +2035,6 @@ suffix = "identica"; hash = icon_hash[identica_service]; break; - case jisko_service: - suffix = "jisko"; - hash = icon_hash[jisko_service]; - break; default: twitter_debug("unknown service\n"); break; @@ -2214,9 +2120,6 @@ case identica_service: url = g_strdup_printf("http://identi.ca/%s", user_name); break; - case jisko_service: - url = g_strdup_printf("http://jisko.net/%s", user_name); - break; default: twitter_debug("unknown service\n"); break; @@ -2230,8 +2133,7 @@ /* gotdata will be released in got_icon_cb */ if(service == twitter_service || service == wassr_service || - service == identica_service || - service == jisko_service) { + service == identica_service) { data->fetch_data = purple_util_fetch_url(url, TRUE, NULL, TRUE, got_page_cb, gotdata); } @@ -2263,9 +2165,6 @@ case identica_service: hash = icon_hash[identica_service]; break; - case jisko_service: - hash = icon_hash[jisko_service]; - break; default: twitter_debug("unknown service\n"); break; @@ -2365,9 +2264,6 @@ case identica_service: hash = icon_hash[identica_service]; break; - case jisko_service: - hash = icon_hash[jisko_service]; - break; default: twitter_debug("unknown service\n"); break; @@ -2517,7 +2413,6 @@ regp[IMAGE_TWITTER] = g_regex_new(P_IMAGE_TWITTER, 0, 0, NULL); regp[IMAGE_WASSR] = g_regex_new(P_IMAGE_WASSR, 0, 0, NULL); regp[IMAGE_IDENTICA] = g_regex_new(P_IMAGE_IDENTICA, 0, 0, NULL); - regp[IMAGE_JISKO] = g_regex_new(P_IMAGE_JISKO, 0, 0, NULL); for(i = twitter_service; i < NUM_SERVICES; i++) { icon_hash[i] = g_hash_table_new_full(g_str_hash, g_str_equal, @@ -2796,13 +2691,6 @@ g_signal_connect(e, "changed", G_CALLBACK(text_changed_cb), &e); - e = GTK_WIDGET(gtk_builder_get_object (builder, "account_jisko")); - g_object_set_data(G_OBJECT(e), "pref", OPT_SCREEN_NAME_JISKO); - text = purple_prefs_get_string(OPT_SCREEN_NAME_JISKO); - gtk_entry_set_text(GTK_ENTRY(e), text); - g_signal_connect(e, "changed", - G_CALLBACK(text_changed_cb), &e); - e = GTK_WIDGET(gtk_builder_get_object (builder, "account_api")); g_object_set_data(G_OBJECT(e), "pref", OPT_API_BASE_POST); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e),
--- a/pidgin-twitter.h Mon Aug 11 10:17:46 2008 +0900 +++ b/pidgin-twitter.h Mon Aug 11 14:31:54 2008 +0900 @@ -36,8 +36,7 @@ CHANNEL, IMAGE_TWITTER, IMAGE_WASSR, - IMAGE_IDENTICA, - IMAGE_JISKO + IMAGE_IDENTICA }; /* service id */ @@ -45,8 +44,7 @@ unknown_service = -1, twitter_service, wassr_service, - identica_service, - jisko_service + identica_service }; /* container to hold icon data */ @@ -113,7 +111,6 @@ #define OPT_SCREEN_NAME_TWITTER OPT_PIDGINTWITTER "/screen_name_twitter" #define OPT_SCREEN_NAME_WASSR OPT_PIDGINTWITTER "/screen_name_wassr" #define OPT_SCREEN_NAME_IDENTICA OPT_PIDGINTWITTER "/screen_name_identica" -#define OPT_SCREEN_NAME_JISKO OPT_PIDGINTWITTER "/screen_name_jisko" #define OPT_PASSWORD_TWITTER OPT_PIDGINTWITTER "/password_twitter" #define OPT_SHOW_ICON OPT_PIDGINTWITTER "/show_icon" #define OPT_ICON_SIZE OPT_PIDGINTWITTER "/icon_size" @@ -130,8 +127,6 @@ #define SENDER_FORMAT_WASSR "%s<a href='http://wassr.jp/user/%s'>%s</a>: " #define RECIPIENT_FORMAT_IDENTICA "@<a href='http://identi.ca/%s'>%s</a>" #define SENDER_FORMAT_IDENTICA "%s<a href='http://identi.ca/%s'>%s</a>: " -#define RECIPIENT_FORMAT_JISKO "@<a href='http://jisko.net/%s'>%s</a>" -#define SENDER_FORMAT_JISKO "%s<a href='http://jisko.net/%s'>%s</a>: " #define CHANNEL_FORMAT_WASSR "%s<a href='http://wassr.jp/channel/%s'>%s</a> " #define DEFAULT_LIST "(list of users: separated with ' ,:;')" #define OOPS_MESSAGE "<body>Oops! Your update was over 140 characters. We sent the short version to your friends (they can view the entire update on the web).<BR></body>" @@ -149,7 +144,6 @@ #define P_IMAGE_TWITTER "<a href=\"/account/profile_image/.+?\"><img .+? id=\"profile-image\".*src=\"(http://.+)\" .+?/>" #define P_IMAGE_WASSR "<div class=\"image\"><a href=\".+\"><img src=\"(.+)\" width=\".+?\" /></a></div>" #define P_IMAGE_IDENTICA "<img src=\"(http://avatar.identi.ca/[A-Za-z0-9-.]+)\" class=\"avatar profile\" width=\"96\" height=\"96\" alt=\"[A-Za-z0-0_]+\"/>" -#define P_IMAGE_JISKO "<img src=\"(http://jisko.net/users/.+/img/avatar/thumb_side\\..+)\" alt=\"Avatar\" />" /* twitter API specific macros */ #define TWITTER_BASE_URL "http://twitter.com" @@ -200,8 +194,6 @@ static gboolean is_wassr_conv(PurpleConversation *conv); static gboolean is_identica_account(PurpleAccount *account, const char *name); static gboolean is_identica_conv(PurpleConversation *conv); -static gboolean is_jisko_account(PurpleAccount *account, const char *name); -static gboolean is_jisko_conv(PurpleConversation *conv); static void conv_created_cb(PurpleConversation *conv, gpointer null); static void deleting_conv_cb(PurpleConversation *conv); static gboolean receiving_im_cb(PurpleAccount *account, char **sender, char **buffer, PurpleConversation *conv, PurpleMessageFlags *flags, void *data);
--- a/prefs.ui Mon Aug 11 10:17:46 2008 +0900 +++ b/prefs.ui Mon Aug 11 14:31:54 2008 +0900 @@ -188,47 +188,6 @@ </packing> </child> <child> - <object class="GtkHBox" id="hbox10"> - <property name="visible">True</property> - <child> - <object class="GtkAlignment" id="alignment43"> - <property name="visible">True</property> - <property name="left_padding">20</property> - <child> - <object class="GtkLabel" id="label30"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">jisko</property> - <property name="max_width_chars">10</property> - </object> - </child> - </object> - </child> - <child> - <object class="GtkAlignment" id="alignment44"> - <property name="visible">True</property> - <property name="xalign">1</property> - <property name="right_padding">4</property> - <child> - <object class="GtkEntry" id="account_jisko"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="width_chars">20</property> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="position">4</property> - </packing> - </child> - <child> <object class="GtkAlignment" id="alignment8"> <property name="visible">True</property> <property name="top_padding">8</property> @@ -245,7 +204,7 @@ </child> </object> <packing> - <property name="position">5</property> + <property name="position">4</property> </packing> </child> <child> @@ -264,7 +223,7 @@ </child> </object> <packing> - <property name="position">6</property> + <property name="position">5</property> </packing> </child> <child> @@ -308,7 +267,7 @@ </child> </object> <packing> - <property name="position">7</property> + <property name="position">6</property> </packing> </child> <child> @@ -377,7 +336,7 @@ </object> <packing> <property name="expand">False</property> - <property name="position">8</property> + <property name="position">7</property> </packing> </child> </object> @@ -539,41 +498,46 @@ <property name="visible">True</property> <property name="n_columns">4</property> <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> + <object class="GtkAlignment" id="alignment18"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> </child> <child> - <placeholder/> - </child> - <child> - <placeholder/> + <object class="GtkAlignment" id="alignment16"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> </child> <child> - <placeholder/> - </child> - <child> - <object class="GtkAlignment" id="alignment40"> + <object class="GtkAlignment" id="alignment45"> <property name="visible">True</property> - <property name="left_padding">40</property> + <property name="right_padding">20</property> <child> - <object class="GtkLabel" id="label24"> + <object class="GtkLabel" id="label27"> <property name="visible">True</property> - <property name="label" translatable="yes">Icon size</property> + <property name="label" translatable="yes">pixel</property> </object> </child> </object> <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</property> <property name="x_options"></property> <property name="y_options"></property> </packing> @@ -600,46 +564,17 @@ </packing> </child> <child> - <object class="GtkAlignment" id="alignment45"> + <object class="GtkAlignment" id="alignment40"> <property name="visible">True</property> - <property name="right_padding">20</property> + <property name="left_padding">40</property> <child> - <object class="GtkLabel" id="label27"> + <object class="GtkLabel" id="label24"> <property name="visible">True</property> - <property name="label" translatable="yes">pixel</property> + <property name="label" translatable="yes">Icon size</property> </object> </child> </object> <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment16"> - <property name="visible">True</property> - <child> - <placeholder/> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment18"> - <property name="visible">True</property> - <child> - <placeholder/> - </child> - </object> - <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> <property name="x_options"></property> <property name="y_options"></property> </packing> @@ -694,60 +629,72 @@ <property name="visible">True</property> <property name="n_columns">6</property> <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> + <object class="GtkAlignment" id="alignment19"> + <property name="visible">True</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="y_options"></property> + </packing> </child> <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <object class="GtkAlignment" id="alignment52"> + <object class="GtkAlignment" id="alignment50"> <property name="visible">True</property> - <property name="right_padding">20</property> + <property name="left_padding">40</property> <child> - <object class="GtkLabel" id="label18"> + <object class="GtkLabel" id="label25"> <property name="visible">True</property> - <property name="label" translatable="yes">days</property> + <property name="label" translatable="yes">Update every</property> </object> </child> </object> <packing> - <property name="left_attach">5</property> - <property name="right_attach">6</property> <property name="x_options"></property> <property name="y_options"></property> </packing> </child> <child> + <object class="GtkAlignment" id="alignment51"> + <property name="visible">True</property> + <property name="left_padding">4</property> + <child> + <object class="GtkSpinButton" id="icon_max_count_spin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="snap_to_ticks">True</property> + <property name="numeric">True</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment53"> + <property name="visible">True</property> + <child> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="label" translatable="yes">times or</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="y_options"></property> + </packing> + </child> + <child> <object class="GtkAlignment" id="alignment54"> <property name="visible">True</property> <property name="left_padding">4</property> @@ -770,71 +717,23 @@ </packing> </child> <child> - <object class="GtkAlignment" id="alignment53"> + <object class="GtkAlignment" id="alignment52"> <property name="visible">True</property> + <property name="right_padding">20</property> <child> - <object class="GtkLabel" id="label3"> + <object class="GtkLabel" id="label18"> <property name="visible">True</property> - <property name="label" translatable="yes">times or</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">3</property> - <property name="right_attach">4</property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment51"> - <property name="visible">True</property> - <property name="left_padding">4</property> - <child> - <object class="GtkSpinButton" id="icon_max_count_spin"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="snap_to_ticks">True</property> - <property name="numeric">True</property> + <property name="label" translatable="yes">days</property> </object> </child> </object> <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> + <property name="left_attach">5</property> + <property name="right_attach">6</property> <property name="x_options"></property> <property name="y_options"></property> </packing> </child> - <child> - <object class="GtkAlignment" id="alignment50"> - <property name="visible">True</property> - <property name="left_padding">40</property> - <child> - <object class="GtkLabel" id="label25"> - <property name="visible">True</property> - <property name="label" translatable="yes">Update every</property> - </object> - </child> - </object> - <packing> - <property name="x_options"></property> - <property name="y_options"></property> - </packing> - </child> - <child> - <object class="GtkAlignment" id="alignment19"> - <property name="visible">True</property> - <child> - <placeholder/> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="y_options"></property> - </packing> - </child> </object> <packing> <property name="expand">False</property>