changeset 208:5d1b8528e144

changed length limit for identi.ca from 140 bytes to 140 characters.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 22 Aug 2008 22:35:03 +0900
parents 0eac0abcc0aa
children d512d1d8712f
files pidgin-twitter.c
diffstat 1 files changed, 2 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin-twitter.c	Fri Aug 22 19:19:52 2008 +0900
+++ b/pidgin-twitter.c	Fri Aug 22 22:35:03 2008 +0900
@@ -1063,14 +1063,12 @@
     gchar *markup = NULL;
     gint service = get_service_type(conv);
     guint count;
-    gchar *text = NULL;
-    GtkTextIter head, tail;
-    guint bytes = 0;
 
     g_return_if_fail(gtkconv != NULL);
 
     switch(service) {
     case twitter_service:
+    case identica_service:
         count = gtk_text_buffer_get_char_count(textbuffer) +
             (unsigned int)g_utf8_strlen(new_text, -1);
         markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>",
@@ -1082,17 +1080,6 @@
         markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>",
                                          count <= 255 ? "black" : "red", count);
         break;
-    case identica_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 <= 140 ? "black" : "red", bytes);
-        break;
     default:
         twitter_debug("unknown service\n");
         break;
@@ -1116,14 +1103,12 @@
     gchar *markup = NULL;
     gint service = get_service_type(conv);
     guint count = 0;
-    gchar *text = NULL;
-    GtkTextIter head, tail;
-    guint bytes = 0;
 
     g_return_if_fail(gtkconv != NULL);
 
     switch(service) {
     case twitter_service:
+    case identica_service:
         count= gtk_text_buffer_get_char_count(textbuffer) -
             (gtk_text_iter_get_offset(end_pos) -
              gtk_text_iter_get_offset(start_pos));
@@ -1137,25 +1122,6 @@
         markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>",
                                          count <= 255 ? "black" : "red", count);
         break;
-    case identica_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 <= 140 ? "black" : "red", bytes);
-        break;
     default:
         twitter_debug("unknown service\n");
         break;