annotate main.c @ 364:cbdf0b35d31b default tip

Added tag 0.9.2.1 for changeset 85e109dee063
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 13 May 2011 00:02:49 +0900
parents 85e109dee063
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1 /*
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
2 * Pidgin-Twitter plugin.
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
3 *
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
4 * This program is free software; you can redistribute it and/or
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
5 * modify it under the terms of the GNU General Public License as
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
6 * published by the Free Software Foundation; either version 2 of the
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
7 * License, or (at your option) any later version.
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
8 *
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful, but
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
12 * General Public License for more details.
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
13 *
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
15 * along with this program; if not, write to the Free Software
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
17 * 02111-1307, USA.
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
18 */
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
19 #define PURPLE_PLUGINS 1
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
20
64
da37857f3033 - separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 63
diff changeset
21 #include "pidgin-twitter.h"
164
5043d4d9766d clean up.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 162
diff changeset
22
119
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
23 /***********/
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
24 /* globals */
119
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
25 /***********/
254
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
26 GRegex *regp[NUM_REGPS];
265
c2944685ac8e - update README to meet 0.8.1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 262
diff changeset
27 GHashTable *icon_hash[NUM_SERVICES];
c2944685ac8e - update README to meet 0.8.1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 262
diff changeset
28 source_t source;
36
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
29 static gboolean suppress_oops = FALSE;
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
30 static GHashTable *conv_hash = NULL;
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
31 static GList *wassr_parrot_list = NULL;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
32 static GList *identica_parrot_list = NULL;
302
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
33 static GList *ffeed_parrot_list = NULL;
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
34 guint64 reply_to_msgid = 0;
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
35 PurpleAccount *account_for_twitter = NULL;
214
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
36 #ifdef _WIN32
260
d973f9debe86 Fix Win32 compile error
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 259
diff changeset
37 gboolean blink_state = FALSE;
d973f9debe86 Fix Win32 compile error
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 259
diff changeset
38 gboolean blink_modified = FALSE;
214
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
39 #endif
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
40
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
41 /**************/
254
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
42 /* prototypes */
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
43 /**************/
254
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
44 static void cleanup_hash_entry_func(gpointer key, gpointer value, gpointer user_data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
45 static void init_plugin(PurplePlugin *plugin);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
46 static gboolean load_plugin(PurplePlugin *plugin);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
47 static gboolean unload_plugin(PurplePlugin *plugin);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
48 static gboolean sending_im_cb(PurpleAccount *account, char *recipient, char **buffer, void *data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
49 static gboolean eval(const GMatchInfo *match_info, GString *result, gpointer user_data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
50 static void translate(gchar **str, gint which, gint service);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
51 static void playsound(gchar **str, gint which);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
52 static gboolean writing_im_cb(PurpleAccount *account, char *sender, char **buffer, PurpleConversation *conv, int flags, void *data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
53 static void insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position, gchar *new_text, gint new_text_length, gpointer user_data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
54 static void delete_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *start_pos, GtkTextIter *end_pos, gpointer user_data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
55 static void detach_from_conv(PurpleConversation *conv, gpointer null);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
56 static void delete_requested_icon_marks(PidginConversation *gtkconv, GHashTable *table);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
57 static void attach_to_conv(PurpleConversation *conv, gpointer null);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
58 static void conv_created_cb(PurpleConversation *conv, gpointer null);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
59 static void deleting_conv_cb(PurpleConversation *conv);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
60 static gboolean receiving_im_cb(PurpleAccount *account, char **sender, char **buffer, PurpleConversation *conv, PurpleMessageFlags *flags, void *data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
61 static void remove_marks_func(gpointer key, gpointer value, gpointer user_data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
62 static void cancel_fetch_func(gpointer key, gpointer value, gpointer user_data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
63 static gboolean displaying_im_cb(PurpleAccount *account, const char *who, char **message, PurpleConversation *conv, PurpleMessageFlags flags, void *data);
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
64 static void displayed_im_cb(PurpleAccount *account, const char *who, char *message, PurpleConversation *conv, PurpleMessageFlags flags);
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
65 #ifndef _WIN32
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
66 extern gchar *sanitize_utf(const gchar *msg, gsize len, gsize *newlen) __attribute__ ((weak));
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
67 #endif
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
68 gboolean pt_uri_handler(const char *proto, const char *cmd, GHashTable *params);
254
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
69
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
70
119
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
71 /*************/
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
72 /* functions */
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
73 /*************/
20
4c236a7a128f - now escape feature works
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 19
diff changeset
74 static gboolean
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
75 sending_im_cb(PurpleAccount *account, char *recipient, char **buffer,
20
4c236a7a128f - now escape feature works
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 19
diff changeset
76 void *data)
4c236a7a128f - now escape feature works
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 19
diff changeset
77 {
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
78 int utflen, bytes;
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
79 int service = get_service_type_by_account(account, recipient);
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
80 gchar *tmp, *plain;
302
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
81 gchar *ffeed_tmp;
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
82 gsize dummy;
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
83
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
84 twitter_debug("called\n");
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
85
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
86 if(service == unknown_service)
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
87 return FALSE;
88
090e28908f09 apply strip_markup() to wassr too.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 87
diff changeset
88
136
e67b0231ba56 completely re-wrote strip_html_markup(). new function permits non-tag strings surrounded by <>.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 135
diff changeset
89 /* strip all markups */
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
90 tmp = strip_html_markup(*buffer);
210
00e26402de03 apply sanitize_utf() if it is available.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 209
diff changeset
91
217
55908ee1467f workaround for that mingw's ld does not support weak declaration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 215
diff changeset
92 #ifndef _WIN32
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
93 if(sanitize_utf) {
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
94 plain = sanitize_utf(tmp, -1, &dummy);
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
95 g_free(tmp);
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
96 }
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
97 else
217
55908ee1467f workaround for that mingw's ld does not support weak declaration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 215
diff changeset
98 #endif
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
99 plain = tmp;
207
0eac0abcc0aa improved parrot blocker. the string to be pushed should not be escaped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 205
diff changeset
100
271
7aad61f56c48 someone broke parrot blocker. yes, it's me!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 269
diff changeset
101 switch(service) {
7aad61f56c48 someone broke parrot blocker. yes, it's me!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 269
diff changeset
102 case wassr_service:
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
103 /* store sending message to address parrot problem */
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
104 wassr_parrot_list =
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
105 g_list_prepend(wassr_parrot_list, g_strdup(plain));
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
106 twitter_debug("wassr parrot pushed:%s\n", plain);
271
7aad61f56c48 someone broke parrot blocker. yes, it's me!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 269
diff changeset
107 break;
7aad61f56c48 someone broke parrot blocker. yes, it's me!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 269
diff changeset
108 case identica_service:
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
109 /* store sending message to address parrot problem */
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
110 identica_parrot_list =
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
111 g_list_prepend(identica_parrot_list, g_strdup(plain));
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
112 twitter_debug("identica parrot pushed:%s\n", plain);
271
7aad61f56c48 someone broke parrot blocker. yes, it's me!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 269
diff changeset
113 break;
302
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
114 case ffeed_service:
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
115 /* store sending message to address parrot problem */
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
116 ffeed_parrot_list =
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
117 g_list_prepend(ffeed_parrot_list, g_strdup(plain));
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
118 twitter_debug("ffeed parrot pushed:%s\n", plain);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
119
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
120 /* prepend @me */
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
121 ffeed_tmp = g_strdup_printf("@me %s", plain);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
122 g_free(plain);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
123 plain = ffeed_tmp;
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
124 break;
271
7aad61f56c48 someone broke parrot blocker. yes, it's me!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 269
diff changeset
125 default:
7aad61f56c48 someone broke parrot blocker. yes, it's me!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 269
diff changeset
126 break;
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
127 }
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
128
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
129 g_free(*buffer);
290
6a206fbc6e46 do not apply xml escape to sending message.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 289
diff changeset
130 *buffer = plain;
268
0926fa46afe0 simplify sending_im_cb() a bit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 265
diff changeset
131
88
090e28908f09 apply strip_markup() to wassr too.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 87
diff changeset
132 /* return here if the message is not to twitter */
274
934c4b053247 fixed a breakage which had prevented post to twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 271
diff changeset
133 if(service != twitter_service)
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
134 return FALSE;
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
135
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
136 /* escape pseudo command */
274
934c4b053247 fixed a breakage which had prevented post to twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 271
diff changeset
137 if(service == twitter_service &&
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
138 purple_prefs_get_bool(OPT_ESCAPE_PSEUDO)) {
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
139 escape(buffer);
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
140 }
40
e60e6cbdc4c4 - added is_twitter_account().
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 39
diff changeset
141
72
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
142 /* update status with Twitter API instead of IM protocol */
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
143 if (purple_prefs_get_bool(OPT_API_BASE_POST)) {
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
144 if (buffer && *buffer) {
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
145 post_status_with_api(account, buffer);
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
146 (*buffer)[0] = '\0';
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
147 }
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
148 return FALSE;
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
149 }
74
6b9593d1ffed quick hack to suppress annoying completion message from wassr.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 73
diff changeset
150
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
151 /* try to suppress oops message */
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
152 utflen = g_utf8_strlen(*buffer, -1);
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
153 bytes = strlen(*buffer);
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
154 twitter_debug("utflen = %d bytes = %d\n", utflen, bytes);
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
155 if(bytes > 140 && utflen <= 140)
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
156 suppress_oops = TRUE;
40
e60e6cbdc4c4 - added is_twitter_account().
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 39
diff changeset
157
20
4c236a7a128f - now escape feature works
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 19
diff changeset
158 return FALSE;
4c236a7a128f - now escape feature works
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 19
diff changeset
159 }
4c236a7a128f - now escape feature works
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 19
diff changeset
160
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
161 static gboolean
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
162 eval(const GMatchInfo *match_info, GString *result, gpointer user_data)
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
163 {
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
164 eval_data *data = (eval_data *)user_data;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
165 gint which = data->which;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
166 gint service = data->service;
222
b168502b73c3 expanded size of substitution buffer to 32KB. 128 bytes were not sufficient if both user name and channel name are rather long. tenforward reported this problem and umq pointed out the cause.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 221
diff changeset
167 gchar sub[SUBST_BUF_SIZE];
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
168
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
169 twitter_debug("which = %d service = %d\n", which, service);
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
170
48
42869098eda3 adapted for msn style option (or new line plugin).
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 46
diff changeset
171 if(which == RECIPIENT) {
223
c3efae72f72a tweaked the recipient pattern to allow mail addresses or some special strings such as "idolm@ster."
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 222
diff changeset
172 gchar *match1 = g_match_info_fetch(match_info, 1); /* preceding \s */
c3efae72f72a tweaked the recipient pattern to allow mail addresses or some special strings such as "idolm@ster."
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 222
diff changeset
173 gchar *match2 = g_match_info_fetch(match_info, 2); /* recipient */
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
174 const gchar *format = NULL;
223
c3efae72f72a tweaked the recipient pattern to allow mail addresses or some special strings such as "idolm@ster."
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 222
diff changeset
175
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
176 switch(service) {
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
177 case twitter_service:
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
178 format = RECIPIENT_FORMAT_TWITTER;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
179 break;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
180 case wassr_service:
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
181 format = RECIPIENT_FORMAT_WASSR;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
182 break;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
183 case identica_service:
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
184 format = RECIPIENT_FORMAT_IDENTICA;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
185 break;
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
186 case jisko_service:
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
187 format = RECIPIENT_FORMAT_JISKO;
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
188 break;
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
189 case ffeed_service:
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
190 format = RECIPIENT_FORMAT_FFEED;
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
191 break;
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
192 default:
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
193 twitter_debug("unknown service\n");
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
194 break;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
195 }
223
c3efae72f72a tweaked the recipient pattern to allow mail addresses or some special strings such as "idolm@ster."
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 222
diff changeset
196 g_snprintf(sub, SUBST_BUF_SIZE, format, match1 ? match1: "", match2, match2);
c3efae72f72a tweaked the recipient pattern to allow mail addresses or some special strings such as "idolm@ster."
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 222
diff changeset
197 g_free(match1);
c3efae72f72a tweaked the recipient pattern to allow mail addresses or some special strings such as "idolm@ster."
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 222
diff changeset
198 g_free(match2);
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
199 }
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
200 else if(which == SENDER) {
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
201 gchar *match1 = g_match_info_fetch(match_info, 1); /* preceding CR|LF */
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
202 gchar *match2 = g_match_info_fetch(match_info, 2); /* sender */
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
203 const gchar *format = NULL;
10
4bd8c89b4749 now it plays sound when sender of message is in the userlist.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 9
diff changeset
204
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
205 switch(service) {
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
206 case twitter_service:
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
207 format = SENDER_FORMAT_TWITTER;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
208 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
209 case wassr_service:
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
210 format = SENDER_FORMAT_WASSR;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
211 break;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
212 case identica_service:
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
213 format = SENDER_FORMAT_IDENTICA;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
214 break;
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
215 case jisko_service:
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
216 format = SENDER_FORMAT_JISKO;
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
217 break;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
218 default:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
219 twitter_debug("unknown service\n");
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
220 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
221 }
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
222
222
b168502b73c3 expanded size of substitution buffer to 32KB. 128 bytes were not sufficient if both user name and channel name are rather long. tenforward reported this problem and umq pointed out the cause.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 221
diff changeset
223 g_snprintf(sub, SUBST_BUF_SIZE, format, match1 ? match1: "", match2, match2);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
224
48
42869098eda3 adapted for msn style option (or new line plugin).
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 46
diff changeset
225 g_free(match1);
42869098eda3 adapted for msn style option (or new line plugin).
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 46
diff changeset
226 g_free(match2);
42869098eda3 adapted for msn style option (or new line plugin).
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 46
diff changeset
227 }
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
228 else if(which == SENDER_FFEED) {
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
229 gchar *match1 = g_match_info_fetch(match_info, 1); /* preceding CR|LF */
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
230 gchar *match2 = g_match_info_fetch(match_info, 2); /* sender */
339
6ee1ed15688c twitter markups tags like "#2.0" as "#2" but those tags only be matched with the query of "#2.0". so, we should handle a punctuation within a string as a normal letter and should strip it only if it is followed by white space.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 337
diff changeset
231 g_snprintf(sub, SUBST_BUF_SIZE, SENDER_FORMAT_FFEED, match1 ? match1: "", match2, match2);
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
232
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
233 g_free(match1);
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
234 g_free(match2);
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
235 }
203
6c6fe6375ce4 revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 202
diff changeset
236 else if(which == CHANNEL_WASSR && service == wassr_service) {
286
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
237 gchar *match1 = g_match_info_fetch(match_info, 1); /* before channel */
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
238 gchar *match2 = g_match_info_fetch(match_info, 2); /* channel */
339
6ee1ed15688c twitter markups tags like "#2.0" as "#2" but those tags only be matched with the query of "#2.0". so, we should handle a punctuation within a string as a normal letter and should strip it only if it is followed by white space.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 337
diff changeset
239 g_snprintf(sub, SUBST_BUF_SIZE, CHANNEL_FORMAT_WASSR, match1 ? match1: "", match2, match2);
97
24ad534e438e linkfy #channelname per user configuration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
240
98
e460e1978ca3 - fixed a bug introduced in r97.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 97
diff changeset
241 g_free(match1);
e460e1978ca3 - fixed a bug introduced in r97.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 97
diff changeset
242 g_free(match2);
97
24ad534e438e linkfy #channelname per user configuration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
243 }
297
e07f28bed8a8 experimental support for search tags in twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 290
diff changeset
244 else if(which == TAG_TWITTER && service == twitter_service) {
341
b41f1bf69cba - twitter still requires preceding white space on a hash tag in almost all case.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 340
diff changeset
245 gchar *match1 = g_match_info_fetch(match_info, 1); /* white space */
b41f1bf69cba - twitter still requires preceding white space on a hash tag in almost all case.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 340
diff changeset
246 gchar *match2 = g_match_info_fetch(match_info, 2); /* search tag */
b41f1bf69cba - twitter still requires preceding white space on a hash tag in almost all case.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 340
diff changeset
247 g_snprintf(sub, SUBST_BUF_SIZE, TAG_FORMAT_TWITTER,
b41f1bf69cba - twitter still requires preceding white space on a hash tag in almost all case.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 340
diff changeset
248 match1 ? match1 : "", match2, match2);
b41f1bf69cba - twitter still requires preceding white space on a hash tag in almost all case.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 340
diff changeset
249 g_free(match1);
b41f1bf69cba - twitter still requires preceding white space on a hash tag in almost all case.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 340
diff changeset
250 g_free(match2);
297
e07f28bed8a8 experimental support for search tags in twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 290
diff changeset
251 }
203
6c6fe6375ce4 revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 202
diff changeset
252 else if(which == TAG_IDENTICA && service == identica_service) {
6c6fe6375ce4 revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 202
diff changeset
253 gchar *match = g_match_info_fetch(match_info, 1);
229
29c741b1b921 supports identi.ca's quirky tag notation.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 228
diff changeset
254 gchar *link = g_ascii_strdown(match, -1);
231
a93a85623a92 identi.ca tag requires '-' to be stripped as well.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 229
diff changeset
255 purple_str_strip_char(link, '-');
229
29c741b1b921 supports identi.ca's quirky tag notation.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 228
diff changeset
256 purple_str_strip_char(link, '_');
286
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
257 g_snprintf(sub, SUBST_BUF_SIZE, TAG_FORMAT_IDENTICA, link, match);
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
258 g_free(match);
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
259 g_free(link);
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
260 }
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
261 else if(which == GROUP_IDENTICA && service == identica_service) {
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
262 gchar *match = g_match_info_fetch(match_info, 1);
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
263 gchar *link = g_ascii_strdown(match, -1);
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
264 purple_str_strip_char(link, '-');
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
265 purple_str_strip_char(link, '_');
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
266 g_snprintf(sub, SUBST_BUF_SIZE, GROUP_FORMAT_IDENTICA, link, match);
203
6c6fe6375ce4 revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 202
diff changeset
267 g_free(match);
229
29c741b1b921 supports identi.ca's quirky tag notation.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 228
diff changeset
268 g_free(link);
202
67d8eaba446d preliminary identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 201
diff changeset
269 }
239
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
270 else if(which == EXCESS_LF) {
243
80be57d8b6fa eliminate blank line
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 242
diff changeset
271 g_snprintf(sub, SUBST_BUF_SIZE, "%s", "\n");
239
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
272 }
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
273 else if(which == TRAIL_HASH) {
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
274 g_snprintf(sub, SUBST_BUF_SIZE, "%s", ""); /* xxx --yaz */
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
275 }
48
42869098eda3 adapted for msn style option (or new line plugin).
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 46
diff changeset
276
42869098eda3 adapted for msn style option (or new line plugin).
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 46
diff changeset
277 g_string_append(result, sub);
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
278 twitter_debug("sub = %s\n", sub);
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
279
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
280 return FALSE;
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
281 }
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
282
8
2c7c9eb4cdda added soundid selector
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 7
diff changeset
283 static void
239
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
284 translate(gchar **str, gint regp_id, gint service)
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
285 {
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
286 gchar *newstr;
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
287 eval_data *data = g_new0(eval_data, 1);
239
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
288
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
289 data->which = regp_id;
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
290 data->service = service;
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
291
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
292 newstr = g_regex_replace_eval(regp[regp_id], /* compiled regex */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
293 *str, /* subject string */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
294 -1, /* length of the subject string */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
295 0, /* start position */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
296 0, /* match options */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
297 eval, /* function to be called for each match */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
298 data, /* user data */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
299 NULL); /* error handler */
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
300
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
301 g_free(data); data = NULL;
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
302
239
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
303 twitter_debug("which = %d *str = %s newstr = %s\n", regp_id, *str, newstr);
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
304
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
305 g_free(*str);
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
306 *str = newstr;
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
307 }
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
308
8
2c7c9eb4cdda added soundid selector
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 7
diff changeset
309 static void
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
310 playsound(gchar **str, gint which)
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
311 {
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
312 GMatchInfo *match_info;
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
313 const gchar *list = NULL;
7
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
314 gchar **candidates = NULL, **candidate = NULL;
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
315
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
316 list = purple_prefs_get_string(which ? OPT_USERLIST_SENDER :
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
317 OPT_USERLIST_RECIPIENT);
5
6ac1867d7e8e string list should be initialized with NULL
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2
diff changeset
318 g_return_if_fail(list != NULL);
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
319 if(strstr(list, DEFAULT_LIST))
7
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
320 return;
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
321
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
322 candidates = g_strsplit_set(list, " ,:;", 0);
20
4c236a7a128f - now escape feature works
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 19
diff changeset
323 g_return_if_fail(candidates != NULL);
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
324
10
4bd8c89b4749 now it plays sound when sender of message is in the userlist.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 9
diff changeset
325 g_regex_match(regp[which], *str, 0, &match_info);
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
326 while(g_match_info_matches(match_info)) {
52
ac1259fde1d0 due to adaptation to msn style, username of sender has been carried down by one.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 51
diff changeset
327 gchar *user = NULL;
ac1259fde1d0 due to adaptation to msn style, username of sender has been carried down by one.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 51
diff changeset
328 if(which == RECIPIENT)
244
c6c2bb8039ce fixed a breakage of playing sound for the recipients.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 243
diff changeset
329 user = g_match_info_fetch(match_info, 2);
52
ac1259fde1d0 due to adaptation to msn style, username of sender has been carried down by one.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 51
diff changeset
330 else if(which == SENDER)
ac1259fde1d0 due to adaptation to msn style, username of sender has been carried down by one.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 51
diff changeset
331 user = g_match_info_fetch(match_info, 2);
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
332 twitter_debug("user = %s\n", user);
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
333
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
334 for(candidate = candidates; *candidate; candidate++) {
7
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
335 if(!strcmp(*candidate, ""))
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
336 continue;
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
337 twitter_debug("candidate = %s\n", *candidate);
9
c6b80f47d4df added capability to translate sender name into link
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 8
diff changeset
338 if(!strcmp(user, *candidate)) {
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
339 twitter_debug("match. play sound\n");
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
340 purple_sound_play_event(purple_prefs_get_int
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
341 (which ? OPT_SOUNDID_SENDER :
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
342 OPT_SOUNDID_RECIPIENT), NULL);
7
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
343 break;
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
344 }
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
345 }
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
346 g_free(user);
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
347 g_match_info_next(match_info, NULL);
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
348 }
7
44a66c52b190 - userlist no longer uses string list. now ' ,:;' separated string is used instead.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 6
diff changeset
349 g_strfreev(candidates);
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
350 g_match_info_free(match_info);
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
351 }
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
352
1
799955af57ad alpha version
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 0
diff changeset
353 static gboolean
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
354 writing_im_cb(PurpleAccount *account, char *sender, char **buffer,
91
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
355 PurpleConversation *conv, int flags, void *data)
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
356 {
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
357 twitter_debug("called\n");
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
358
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
359 gint service = get_service_type(conv);
331
b4c846870b3c improved handling of RT string
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 330
diff changeset
360 gchar *linkstr = NULL, *tmpstr = NULL;
337
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
361 gchar *escaped = NULL;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
362
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
363 /* check if the conversation is between twitter */
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
364 if(service == unknown_service)
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
365 return FALSE;
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
366
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
367 /* add screen_name if the current message is posted by myself */
91
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
368 if (flags & PURPLE_MESSAGE_SEND) {
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
369 gchar *m = NULL;
145
f220da0c089e screen_name should be initialized.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 142
diff changeset
370 const char *screen_name = NULL;
110
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
371
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
372 switch(service) {
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
373 case twitter_service:
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
374 screen_name = purple_prefs_get_string(OPT_SCREEN_NAME_TWITTER);
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
375 break;
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
376 case wassr_service:
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
377 screen_name = purple_prefs_get_string(OPT_SCREEN_NAME_WASSR);
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
378 break;
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
379 case identica_service:
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
380 screen_name = purple_prefs_get_string(OPT_SCREEN_NAME_IDENTICA);
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
381 break;
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
382 case jisko_service:
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
383 screen_name = purple_prefs_get_string(OPT_SCREEN_NAME_JISKO);
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
384 break;
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
385 case ffeed_service:
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
386 screen_name = purple_prefs_get_string(OPT_SCREEN_NAME_FFEED);
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
387 break;
110
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
388 }
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
389
91
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
390 if (screen_name) {
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
391 m = g_strdup_printf("%s: %s", screen_name, *buffer);
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
392 g_free(*buffer);
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
393 *buffer = m;
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
394 }
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
395 } /* send */
91
2b7ef3538cd3 - Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 85
diff changeset
396
337
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
397
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
398 /* note:
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
399 link string needs stripped plain text.
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
400 displaying needs markup-escaped that text. */
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
401
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
402 /* strip all markups */
331
b4c846870b3c improved handling of RT string
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 330
diff changeset
403 strip_markup(buffer, FALSE);
10
4bd8c89b4749 now it plays sound when sender of message is in the userlist.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 9
diff changeset
404
337
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
405 /* make R F RT link string */
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
406 if(service == twitter_service)
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
407 linkstr = twitter_rip_link_string(buffer);
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
408
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
409 /* entity markup for displaying */
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
410 escaped = g_markup_escape_text(*buffer, -1);
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
411 g_free(*buffer);
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
412 *buffer = escaped;
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
413
9f78fb6bfc76 gtkimhtml easily be fooled if the buffer is not entity markuped.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 336
diff changeset
414
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
415 /* playsound */
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
416 if(purple_prefs_get_bool(OPT_PLAYSOUND_SENDER)) {
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
417 playsound(buffer, SENDER);
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
418 }
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
419 if(purple_prefs_get_bool(OPT_PLAYSOUND_RECIPIENT)) {
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
420 playsound(buffer, RECIPIENT);
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
421 }
41
0a81ccfa1941 strip excessive markup where it is not needed. (work in progress)
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 40
diff changeset
422
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
423 /* translate */
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
424 if(purple_prefs_get_bool(OPT_TRANSLATE_SENDER)) {
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
425 if(service == ffeed_service)
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
426 translate(buffer, SENDER_FFEED, service);
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
427 else
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
428 translate(buffer, SENDER, service);
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
429 }
202
67d8eaba446d preliminary identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 201
diff changeset
430 if(purple_prefs_get_bool(OPT_TRANSLATE_RECIPIENT)) {
67d8eaba446d preliminary identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 201
diff changeset
431 translate(buffer, RECIPIENT, service);
67d8eaba446d preliminary identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 201
diff changeset
432 }
97
24ad534e438e linkfy #channelname per user configuration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
433 if(service == wassr_service &&
24ad534e438e linkfy #channelname per user configuration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
434 purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) {
203
6c6fe6375ce4 revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 202
diff changeset
435 translate(buffer, CHANNEL_WASSR, service);
97
24ad534e438e linkfy #channelname per user configuration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
436 }
202
67d8eaba446d preliminary identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 201
diff changeset
437 if(service == identica_service &&
67d8eaba446d preliminary identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 201
diff changeset
438 purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) {
203
6c6fe6375ce4 revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 202
diff changeset
439 translate(buffer, TAG_IDENTICA, service);
98
e460e1978ca3 - fixed a bug introduced in r97.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 97
diff changeset
440 }
297
e07f28bed8a8 experimental support for search tags in twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 290
diff changeset
441 if(service == twitter_service &&
e07f28bed8a8 experimental support for search tags in twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 290
diff changeset
442 purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) {
e07f28bed8a8 experimental support for search tags in twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 290
diff changeset
443 translate(buffer, TAG_TWITTER, service);
e07f28bed8a8 experimental support for search tags in twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 290
diff changeset
444 }
286
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
445 if(service == identica_service &&
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
446 purple_prefs_get_bool(OPT_TRANSLATE_CHANNEL)) {
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
447 translate(buffer, GROUP_IDENTICA, service);
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
448 }
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
449
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
450 if(service == twitter_service) {
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
451 /* escape pseudo command (to show the same result as
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
452 sending message) */
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
453 if(purple_prefs_get_bool(OPT_ESCAPE_PSEUDO)) {
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
454 escape(buffer);
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
455 }
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
456
331
b4c846870b3c improved handling of RT string
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 330
diff changeset
457 tmpstr = g_strconcat(*buffer, linkstr, NULL);
b4c846870b3c improved handling of RT string
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 330
diff changeset
458 g_free(linkstr);
b4c846870b3c improved handling of RT string
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 330
diff changeset
459 g_free(*buffer);
b4c846870b3c improved handling of RT string
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 330
diff changeset
460 *buffer = tmpstr;
44
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
461 }
4f456c7150ed cleanups
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 43
diff changeset
462
239
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
463 if(purple_prefs_get_bool(OPT_STRIP_EXCESS_LF)) {
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
464 translate(buffer, EXCESS_LF, service);
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
465 }
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
466
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
467 if(service == ffeed_service) {
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
468 translate(buffer, TRAIL_HASH, service);
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
469 }
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
470
19
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
471 return FALSE;
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
472 }
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
473
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
474 static void
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
475 insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position,
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
476 gchar *new_text, gint new_text_length, gpointer user_data)
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
477 {
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
478 PurpleConversation *conv = (PurpleConversation *)user_data;
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
479 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
480
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
481 GtkWidget *box, *counter = NULL;
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
482 gchar *markup = NULL;
102
55c466028d48 changed letter counter for identi.ca to count in byte.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 101
diff changeset
483 gint service = get_service_type(conv);
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
484 guint count;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
485
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
486 g_return_if_fail(gtkconv != NULL);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
487
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
488 switch(service) {
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
489 case twitter_service:
208
5d1b8528e144 changed length limit for identi.ca from 140 bytes to 140 characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 207
diff changeset
490 case identica_service:
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
491 case jisko_service:
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
492 case ffeed_service:
102
55c466028d48 changed letter counter for identi.ca to count in byte.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 101
diff changeset
493 count = gtk_text_buffer_get_char_count(textbuffer) +
55c466028d48 changed letter counter for identi.ca to count in byte.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 101
diff changeset
494 (unsigned int)g_utf8_strlen(new_text, -1);
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
495 markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>",
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
496 count <= 140 ? "black" : "red", count);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
497 break;
199
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
498 case wassr_service:
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
499 count = gtk_text_buffer_get_char_count(textbuffer) +
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
500 (unsigned int)g_utf8_strlen(new_text, -1);
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
501 markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>",
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
502 count <= 255 ? "black" : "red", count);
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
503 break;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
504 default:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
505 twitter_debug("unknown service\n");
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
506 break;
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
507 }
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
508
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
509 box = gtkconv->toolbar;
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
510 counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter");
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
511 if(counter)
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
512 gtk_label_set_markup(GTK_LABEL(counter), markup);
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
513
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
514 g_free(markup);
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
515 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
516
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
517 static void
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
518 delete_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *start_pos,
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
519 GtkTextIter *end_pos, gpointer user_data)
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
520 {
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
521 PurpleConversation *conv = (PurpleConversation *)user_data;
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
522 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
523 GtkWidget *box, *counter = NULL;
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
524 gchar *markup = NULL;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
525 gint service = get_service_type(conv);
102
55c466028d48 changed letter counter for identi.ca to count in byte.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 101
diff changeset
526 guint count = 0;
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
527
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
528 g_return_if_fail(gtkconv != NULL);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
529
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
530 switch(service) {
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
531 case twitter_service:
208
5d1b8528e144 changed length limit for identi.ca from 140 bytes to 140 characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 207
diff changeset
532 case identica_service:
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
533 case jisko_service:
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
534 case ffeed_service:
102
55c466028d48 changed letter counter for identi.ca to count in byte.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 101
diff changeset
535 count= gtk_text_buffer_get_char_count(textbuffer) -
55c466028d48 changed letter counter for identi.ca to count in byte.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 101
diff changeset
536 (gtk_text_iter_get_offset(end_pos) -
55c466028d48 changed letter counter for identi.ca to count in byte.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 101
diff changeset
537 gtk_text_iter_get_offset(start_pos));
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
538 markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>",
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
539 count <= 140 ? "black" : "red", count);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
540 break;
199
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
541 case wassr_service:
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
542 count= gtk_text_buffer_get_char_count(textbuffer) -
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
543 (gtk_text_iter_get_offset(end_pos) -
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
544 gtk_text_iter_get_offset(start_pos));
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
545 markup = g_markup_printf_escaped("<span color=\"%s\">%u</span>",
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
546 count <= 255 ? "black" : "red", count);
5ddf8bee768d according to mojin, jisko limits each post to 140 bytes and requires at least 5 bytes. now letter counter for jisko takes account of this limit.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 198
diff changeset
547 break;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
548 default:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
549 twitter_debug("unknown service\n");
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
550 break;
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
551 }
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
552
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
553 if(count == 0)
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
554 reply_to_msgid = 0;
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
555
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
556 box = gtkconv->toolbar;
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
557 counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter");
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
558 if(counter)
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
559 gtk_label_set_markup(GTK_LABEL(counter), markup);
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
560
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
561 g_free(markup);
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
562 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
563
254
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
564 void
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
565 detach_from_window(void)
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
566 {
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
567 GList *list;
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
568
40
e60e6cbdc4c4 - added is_twitter_account().
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 39
diff changeset
569 /* find twitter conv window out and detach from that */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
570 for(list = pidgin_conv_windows_get_list(); list; list = list->next) {
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
571 PidginWindow *win = list->data;
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
572 PurpleConversation *conv =
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
573 pidgin_conv_window_get_active_conversation(win);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
574 gint service = get_service_type(conv);
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
575 switch(service) {
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
576 case twitter_service:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
577 case wassr_service:
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
578 case identica_service:
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
579 case jisko_service:
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
580 case ffeed_service:
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
581 detach_from_conv(conv, NULL);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
582 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
583 default:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
584 twitter_debug("unknown service\n");
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
585 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
586 }
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
587 }
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
588 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
589
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
590 static void
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
591 detach_from_conv(PurpleConversation *conv, gpointer null)
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
592 {
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
593 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
594 GtkWidget *box, *counter = NULL, *sep = NULL;
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
595
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
596 g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->entry_buffer),
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
597 (GFunc) insert_text_cb, conv);
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
598 g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->entry_buffer),
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
599 (GFunc) delete_text_cb, conv);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
600
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
601 box = gtkconv->toolbar;
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
602
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
603 /* remove counter */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
604 counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter");
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
605 if(counter) {
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
606 gtk_container_remove(GTK_CONTAINER(box), counter);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
607 g_object_unref(counter);
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
608 g_object_set_data(G_OBJECT(box), PLUGIN_ID "-counter", NULL);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
609 }
37
bafe2abf2d3b - made suppress oops configurable
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 36
diff changeset
610
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
611 /* remove separator */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
612 sep = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-sep");
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
613 if(sep) {
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
614 gtk_container_remove(GTK_CONTAINER(box), sep);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
615 g_object_unref(sep);
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
616 g_object_set_data(G_OBJECT(box), PLUGIN_ID "-sep", NULL);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
617 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
618
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
619 gtk_widget_queue_draw(pidgin_conv_get_window(gtkconv)->window);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
620 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
621
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
622 static void
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
623 remove_marks_func(gpointer key, gpointer value, gpointer user_data)
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
624 {
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
625 icon_data *data = (icon_data *)value;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
626 GtkTextBuffer *text_buffer = (GtkTextBuffer *)user_data;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
627 GList *mark_list = NULL;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
628 GList *current;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
629
111
799b28f181f8 added UI for icon size.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 110
diff changeset
630 if(!data)
799b28f181f8 added UI for icon size.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 110
diff changeset
631 return;
799b28f181f8 added UI for icon size.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 110
diff changeset
632
799b28f181f8 added UI for icon size.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 110
diff changeset
633 if(data->request_list)
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
634 mark_list = data->request_list;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
635
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
636 /* remove the marks in its GtkTextBuffers */
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
637 current = g_list_first(mark_list);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
638 while(current) {
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
639 GtkTextMark *current_mark = current->data;
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
640 GtkTextBuffer *current_text_buffer =
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
641 gtk_text_mark_get_buffer(current_mark);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
642 GList *next;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
643
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
644 next = g_list_next(current);
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
645
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
646 if(!current_text_buffer)
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
647 continue;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
648
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
649 if(text_buffer) {
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
650 if(current_text_buffer == text_buffer) {
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
651 /* the mark will be freed in this function */
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
652 gtk_text_buffer_delete_mark(current_text_buffer,
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
653 current_mark);
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
654 current->data = NULL;
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
655 mark_list = g_list_delete_link(mark_list, current);
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
656 }
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
657 }
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
658 else {
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
659 gtk_text_buffer_delete_mark(current_text_buffer, current_mark);
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
660 current->data = NULL;
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
661 mark_list = g_list_delete_link(mark_list, current);
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
662 }
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
663
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
664 current = next;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
665 }
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
666
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
667 data->request_list = mark_list;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
668 }
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
669
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
670 static void
84
0c1f63882b8a preliminary wassr icon support. not yet completed.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 83
diff changeset
671 delete_requested_icon_marks(PidginConversation *conv, GHashTable *table) {
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
672 GtkTextBuffer *text_buffer = gtk_text_view_get_buffer(
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
673 GTK_TEXT_VIEW(conv->imhtml));
64
da37857f3033 - separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 63
diff changeset
674
84
0c1f63882b8a preliminary wassr icon support. not yet completed.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 83
diff changeset
675 g_hash_table_foreach(table,
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
676 (GHFunc)remove_marks_func,
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
677 (gpointer)text_buffer);
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
678 }
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
679
254
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
680 void
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
681 attach_to_window(void)
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
682 {
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
683 GList *list;
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
684
119
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
685 twitter_debug("called\n");
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
686
40
e60e6cbdc4c4 - added is_twitter_account().
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 39
diff changeset
687 /* find twitter conv window out and attach to that */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
688 for(list = pidgin_conv_windows_get_list(); list; list = list->next) {
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
689 PidginWindow *win = list->data;
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
690 PurpleConversation *conv =
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
691 pidgin_conv_window_get_active_conversation(win);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
692 gint service = get_service_type(conv);
51
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
693 /* only attach to twitter conversation window */
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
694 switch(service) {
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
695 case twitter_service:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
696 case wassr_service:
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
697 case identica_service:
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
698 case jisko_service:
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
699 case ffeed_service:
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
700 attach_to_conv(conv, NULL);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
701 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
702 default:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
703 twitter_debug("unknown service\n");
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
704 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
705 }
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
706 }
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
707 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
708
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
709 static void
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
710 attach_to_conv(PurpleConversation *conv, gpointer null)
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
711 {
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
712 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
50
3e0d4fd75b03 added that to disable widgets that decorate or link text.
mikanbako <maoutwo@gmail.com>
parents: 49
diff changeset
713 GtkWidget *box, *sep, *counter, *menus;
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
714
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
715 box = gtkconv->toolbar;
51
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
716
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
717 /* Disable widgets that decorate or add link to composing text
53
872f418ba45d - revised README
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 52
diff changeset
718 * because Twitter cannot receive marked up string. For lean-view
51
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
719 * and wide-view, see pidgin/gtkimhtmltoolbar.c.
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
720 */
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
721 menus = g_object_get_data(G_OBJECT(box), "lean-view");
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
722 if(menus) {
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
723 gtk_widget_set_sensitive(GTK_WIDGET(menus), FALSE);
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
724 }
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
725 menus = g_object_get_data(G_OBJECT(box), "wide-view");
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
726 if(menus) {
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
727 gtk_widget_set_sensitive(GTK_WIDGET(menus), FALSE);
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
728 }
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
729
51
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
730 purple_conversation_set_features(
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
731 gtkconv->active_conv,
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
732 purple_conversation_get_features(gtkconv->active_conv) &
64
da37857f3033 - separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 63
diff changeset
733 ~PURPLE_CONNECTION_HTML);
51
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
734
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
735 /* check if the counter is enabled */
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
736 if(!purple_prefs_get_bool(OPT_COUNTER))
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
737 return;
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
738
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
739 /* get counter object */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
740 counter = g_object_get_data(G_OBJECT(box), PLUGIN_ID "-counter");
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
741 g_return_if_fail(counter == NULL);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
742
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
743 /* make counter object */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
744 counter = gtk_label_new(NULL);
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
745 gtk_widget_set_name(counter, "counter_label");
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
746 gtk_label_set_text(GTK_LABEL(counter), "0");
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
747 gtk_box_pack_end(GTK_BOX(box), counter, FALSE, FALSE, 0);
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
748 gtk_widget_show_all(counter);
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
749 g_object_set_data(G_OBJECT(box), PLUGIN_ID "-counter", counter);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
750
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
751 /* make separator object */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
752 sep = gtk_vseparator_new();
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
753 gtk_box_pack_end(GTK_BOX(box), sep, FALSE, FALSE, 0);
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
754 gtk_widget_show_all(sep);
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
755 g_object_set_data(G_OBJECT(box), PLUGIN_ID "-sep", sep);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
756
51
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
757 /* connect to signals */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
758 g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "insert_text",
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
759 G_CALLBACK(insert_text_cb), conv);
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
760 g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "delete_range",
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
761 G_CALLBACK(delete_text_cb), conv);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
762
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
763 /* redraw window */
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
764 gtk_widget_queue_draw(pidgin_conv_get_window(gtkconv)->window);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
765 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
766
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
767 static void
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
768 conv_created_cb(PurpleConversation *conv, gpointer null)
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
769 {
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
770 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
119
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
771
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
772 twitter_debug("called\n");
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
773
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
774 g_return_if_fail(gtkconv != NULL);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
775
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
776 gint service = get_service_type(conv);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
777 /* only attach to twitter conversation window */
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
778 switch(service) {
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
779 case twitter_service:
158
ae09f0d93b17 fixed a bug that get_status_with_api() will never be called if pidgin-twitter started with api_based_post disabled. it must be submitted to main loop regardless of configuration.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 157
diff changeset
780 get_status_with_api((gpointer)conv);
ae09f0d93b17 fixed a bug that get_status_with_api() will never be called if pidgin-twitter started with api_based_post disabled. it must be submitted to main loop regardless of configuration.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 157
diff changeset
781 source.id = g_timeout_add_seconds(
ae09f0d93b17 fixed a bug that get_status_with_api() will never be called if pidgin-twitter started with api_based_post disabled. it must be submitted to main loop regardless of configuration.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 157
diff changeset
782 purple_prefs_get_int(OPT_API_BASE_GET_INTERVAL),
ae09f0d93b17 fixed a bug that get_status_with_api() will never be called if pidgin-twitter started with api_based_post disabled. it must be submitted to main loop regardless of configuration.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 157
diff changeset
783 get_status_with_api, (gpointer)conv);
ae09f0d93b17 fixed a bug that get_status_with_api() will never be called if pidgin-twitter started with api_based_post disabled. it must be submitted to main loop regardless of configuration.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 157
diff changeset
784 source.conv = conv;
115
7d0dd0e1dbd0 very preliminary twitter API get status feature.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 113
diff changeset
785 attach_to_conv(conv, NULL);
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
786 account_for_twitter = conv->account; /* xxx */
115
7d0dd0e1dbd0 very preliminary twitter API get status feature.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 113
diff changeset
787 break;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
788 case wassr_service:
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
789 case identica_service:
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
790 case jisko_service:
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
791 case ffeed_service:
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
792 attach_to_conv(conv, NULL);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
793 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
794 default:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
795 twitter_debug("unknown service\n");
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
796 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
797 }
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
798 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
799
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
800 static void
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
801 deleting_conv_cb(PurpleConversation *conv)
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
802 {
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
803 PidginConversation *gtkconv = PIDGIN_CONVERSATION(conv);
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
804
119
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
805 twitter_debug("called\n");
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
806
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
807 g_return_if_fail(gtkconv != NULL);
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
808
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
809 gint service = get_service_type(conv);
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
810 GHashTable *hash = NULL;
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
811
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
812 /* only attach to twitter conversation window */
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
813 switch(service) {
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
814 case twitter_service:
156
e65f81211340 now interval setting from UI takes effect immediately.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 155
diff changeset
815 if(purple_prefs_get_bool(OPT_API_BASE_POST)) {
119
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
816 g_source_remove_by_user_data((gpointer)conv);
156
e65f81211340 now interval setting from UI takes effect immediately.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 155
diff changeset
817 source.id = 0;
e65f81211340 now interval setting from UI takes effect immediately.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 155
diff changeset
818 source.conv = NULL;
e65f81211340 now interval setting from UI takes effect immediately.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 155
diff changeset
819 }
262
e9a7c018a952 reduce redundancy
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 261
diff changeset
820 hash = icon_hash[service];
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
821 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
822 case wassr_service:
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
823 case identica_service:
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
824 case jisko_service:
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
825 case ffeed_service:
262
e9a7c018a952 reduce redundancy
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 261
diff changeset
826 hash = icon_hash[service];
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
827 break;
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
828 default:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
829 twitter_debug("unknown service\n");
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
830 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
831 }
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
832
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
833 if(hash)
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
834 delete_requested_icon_marks(gtkconv, hash);
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
835 }
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
836
254
c2620a99622b - divided the source file into several parts.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 253
diff changeset
837 void
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
838 apply_filter(gchar **sender, gchar **buffer, PurpleMessageFlags *flags, int service)
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
839 {
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
840 GMatchInfo *match_info;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
841 const gchar *list = NULL;
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
842 gchar *screen_name = NULL;
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
843 gchar **candidates = NULL, **candidate = NULL;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
844
212
8670e1572be8 fix for a bug that apply_filter() would crash if both sender and buffer have been cleared.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 211
diff changeset
845 g_return_if_fail(*sender != NULL);
8670e1572be8 fix for a bug that apply_filter() would crash if both sender and buffer have been cleared.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 211
diff changeset
846 g_return_if_fail(*buffer != NULL);
8670e1572be8 fix for a bug that apply_filter() would crash if both sender and buffer have been cleared.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 211
diff changeset
847
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
848 gchar *plain = strip_html_markup(*buffer);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
849
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
850 switch(service) {
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
851 case twitter_service:
219
739ed7a4426c revised receiving_im_cb(). conv may be NULL so that filter might not work for messages which arrived at before conversation has been established.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 218
diff changeset
852 default:
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
853 list = purple_prefs_get_string(OPT_FILTER_TWITTER);
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
854 screen_name = g_strdup_printf("@%s", purple_prefs_get_string(OPT_SCREEN_NAME_TWITTER));
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
855 break;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
856 case wassr_service:
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
857 list = purple_prefs_get_string(OPT_FILTER_WASSR);
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
858 screen_name = g_strdup_printf("@%s", purple_prefs_get_string(OPT_SCREEN_NAME_WASSR));
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
859 break;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
860 case identica_service:
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
861 list = purple_prefs_get_string(OPT_FILTER_IDENTICA);
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
862 screen_name = g_strdup_printf("@%s", purple_prefs_get_string(OPT_SCREEN_NAME_IDENTICA));
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
863 break;
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
864 case jisko_service:
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
865 list = purple_prefs_get_string(OPT_FILTER_JISKO);
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
866 screen_name = g_strdup_printf("@%s", purple_prefs_get_string(OPT_SCREEN_NAME_JISKO));
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
867 case ffeed_service:
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
868 list = purple_prefs_get_string(OPT_FILTER_FFEED);
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
869 screen_name = g_strdup_printf("@%s", purple_prefs_get_string(OPT_SCREEN_NAME_FFEED));
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
870 break;
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
871 }
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
872 g_return_if_fail(list != NULL);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
873 if(strstr(list, DEFAULT_LIST))
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
874 return;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
875
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
876 /* find @myself */
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
877 if(purple_prefs_get_bool(OPT_FILTER_EXCLUDE_REPLY) &&
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
878 strstr(plain, screen_name)) {
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
879 g_free(plain);
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
880 g_free(screen_name);
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
881 return;
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
882 }
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
883 else
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
884 g_free(screen_name);
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
885
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
886 candidates = g_strsplit_set(list, " ,:;", 0);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
887 g_return_if_fail(candidates != NULL);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
888
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
889 g_regex_match(regp[SENDER], plain, 0, &match_info);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
890 while(g_match_info_matches(match_info)) {
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
891 gchar *user = NULL;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
892 user = g_match_info_fetch(match_info, 2);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
893 twitter_debug("user = %s\n", user);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
894
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
895 for(candidate = candidates; *candidate; candidate++) {
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
896 if(!strcmp(*candidate, ""))
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
897 continue;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
898 twitter_debug("candidate = %s\n", *candidate);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
899 if(!strcmp(user, *candidate)) {
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
900 twitter_debug("match. filter %s\n", user);
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
901 /* pidgin should handle this flag properly --yaz */
219
739ed7a4426c revised receiving_im_cb(). conv may be NULL so that filter might not work for messages which arrived at before conversation has been established.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 218
diff changeset
902 // *flags |= PURPLE_MESSAGE_INVISIBLE;
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
903
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
904 /* temporal workaround */
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
905 g_free(*sender); *sender = NULL;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
906 g_free(*buffer); *buffer = NULL;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
907 break;
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
908 }
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
909 }
212
8670e1572be8 fix for a bug that apply_filter() would crash if both sender and buffer have been cleared.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 211
diff changeset
910
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
911 g_free(user);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
912 g_match_info_next(match_info, NULL);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
913 }
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
914
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
915 g_free(plain);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
916 g_strfreev(candidates);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
917 g_match_info_free(match_info);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
918 }
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
919
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
920
8
2c7c9eb4cdda added soundid selector
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 7
diff changeset
921 static gboolean
36
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
922 receiving_im_cb(PurpleAccount *account, char **sender, char **buffer,
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
923 PurpleConversation *conv, PurpleMessageFlags *flags, void *data)
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
924 {
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
925 twitter_debug("called\n");
39
2ac81c0afb53 - new debug macro. it includes function name and line number.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 38
diff changeset
926 twitter_debug("buffer = %s suppress_oops = %d\n", *buffer, suppress_oops);
36
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
927
219
739ed7a4426c revised receiving_im_cb(). conv may be NULL so that filter might not work for messages which arrived at before conversation has been established.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 218
diff changeset
928 gint service;
739ed7a4426c revised receiving_im_cb(). conv may be NULL so that filter might not work for messages which arrived at before conversation has been established.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 218
diff changeset
929
739ed7a4426c revised receiving_im_cb(). conv may be NULL so that filter might not work for messages which arrived at before conversation has been established.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 218
diff changeset
930 service = get_service_type_by_account(account, *sender);
739ed7a4426c revised receiving_im_cb(). conv may be NULL so that filter might not work for messages which arrived at before conversation has been established.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 218
diff changeset
931 twitter_debug("service = %d\n", service);
138
eaf5d2c4ada0 temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 137
diff changeset
932
214
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
933 #ifdef _WIN32
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
934 /* suppress notification of incoming messages. */
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
935 if(service != unknown_service &&
214
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
936 purple_prefs_get_bool(OPT_PREVENT_NOTIFICATION)) {
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
937 if(!blink_modified) {
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
938 blink_modified = TRUE;
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
939 blink_state = purple_prefs_get_bool(OPT_PIDGIN_BLINK_IM);
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
940 purple_prefs_set_bool(OPT_PIDGIN_BLINK_IM, FALSE);
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
941 }
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
942 }
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
943 else {
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
944 if(blink_modified) {
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
945 purple_prefs_set_bool(OPT_PIDGIN_BLINK_IM, blink_state);
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
946 blink_modified = FALSE;
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
947 }
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
948 }
148fa8a8be8e - trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 212
diff changeset
949 #endif
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
950
138
eaf5d2c4ada0 temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 137
diff changeset
951 if(service == wassr_service) {
218
27651b73a638 fix for a bug that post to wassr's channel which contains entity reference got through parrot blocker.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 217
diff changeset
952 gchar *stripped = strip_html_markup(*buffer);
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
953 /* suppress annoying completion message from wassr */
221
b5fa0c295ff5 pushed message must be matched with received message, otherwise it leaks.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 220
diff changeset
954 if(strstr(*buffer, "<body>チャンネル投稿完了:")) {
b5fa0c295ff5 pushed message must be matched with received message, otherwise it leaks.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 220
diff changeset
955 twitter_debug("clearing channel parrot message\n");
74
6b9593d1ffed quick hack to suppress annoying completion message from wassr.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 73
diff changeset
956 g_free(*sender); *sender = NULL;
6b9593d1ffed quick hack to suppress annoying completion message from wassr.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 73
diff changeset
957 g_free(*buffer); *buffer = NULL;
6b9593d1ffed quick hack to suppress annoying completion message from wassr.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 73
diff changeset
958 }
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
959 /* discard parrot message */
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
960 else {
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
961 GList *current = g_list_first(wassr_parrot_list);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
962 while(current) {
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
963 GList *next = g_list_next(current);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
964
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
965 if(strstr(stripped, current->data)) {
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
966 twitter_debug("parrot clearing: buf = %s post = %s\n",
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
967 *buffer, (char *)current->data);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
968 g_free(*sender); *sender = NULL;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
969 g_free(*buffer); *buffer = NULL;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
970 g_free(current->data);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
971 current->data = NULL;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
972 wassr_parrot_list =
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
973 g_list_delete_link(wassr_parrot_list, current);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
974 break;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
975 }
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
976
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
977 current = next;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
978 }
82
c9600d64781a work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 81
diff changeset
979 }
218
27651b73a638 fix for a bug that post to wassr's channel which contains entity reference got through parrot blocker.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 217
diff changeset
980 g_free(stripped);
74
6b9593d1ffed quick hack to suppress annoying completion message from wassr.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 73
diff changeset
981 }
302
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
982 else if(service == identica_service) {
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
983 /* discard parrot message */
201
0aeeafe37ef7 revised parrot blocker for identi.ca. now it compares stripped text and the stored message.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 200
diff changeset
984 gchar *stripped = strip_html_markup(*buffer);
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
985 GList *current = g_list_first(identica_parrot_list);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
986 while(current) {
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
987 GList *next = g_list_next(current);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
988
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
989 if(strstr(stripped, current->data)) {
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
990 twitter_debug("identica parrot clearing: buf = %s post = %s\n",
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
991 *buffer, (char *)current->data);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
992 g_free(*sender); *sender = NULL;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
993 g_free(*buffer); *buffer = NULL;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
994 g_free(current->data);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
995 current->data = NULL;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
996 identica_parrot_list =
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
997 g_list_delete_link(identica_parrot_list, current);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
998 break;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
999 }
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1000
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1001 current = next;
138
eaf5d2c4ada0 temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 137
diff changeset
1002 }
201
0aeeafe37ef7 revised parrot blocker for identi.ca. now it compares stripped text and the stored message.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 200
diff changeset
1003 g_free(stripped);
138
eaf5d2c4ada0 temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 137
diff changeset
1004 }
302
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1005 else if(service == ffeed_service) {
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1006 /* discard parrot message */
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1007 gchar *stripped = strip_html_markup(*buffer);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1008 GList *current = g_list_first(ffeed_parrot_list);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1009 while(current) {
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1010 GList *next = g_list_next(current);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1011
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1012 if(strstr(stripped, current->data)) {
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1013 twitter_debug("ffeed parrot clearing: buf = %s post = %s\n",
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1014 *buffer, (char *)current->data);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1015 g_free(*sender); *sender = NULL;
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1016 g_free(*buffer); *buffer = NULL;
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1017 g_free(current->data);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1018 current->data = NULL;
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1019 ffeed_parrot_list =
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1020 g_list_delete_link(ffeed_parrot_list, current);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1021 break;
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1022 }
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1023
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1024 current = next;
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1025 }
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1026 g_free(stripped);
e17b74fdf86a more ffeed support:
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 300
diff changeset
1027 }
138
eaf5d2c4ada0 temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 137
diff changeset
1028
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1029 /* filtering */
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1030 if(purple_prefs_get_bool(OPT_FILTER)) {
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1031 apply_filter(sender, buffer, flags, service);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1032 }
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1033
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1034 /* return here if it is not twitter */
138
eaf5d2c4ada0 temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 137
diff changeset
1035 if(service != twitter_service) {
61
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1036 return FALSE;
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1037 }
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1038
194
1495b478680b tentative support for jisko.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 183
diff changeset
1039 /* if we use api, discard all incoming IM messages. */
115
7d0dd0e1dbd0 very preliminary twitter API get status feature.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 113
diff changeset
1040 if(purple_prefs_get_bool(OPT_API_BASE_POST)) {
119
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
1041 g_free(*sender); *sender = NULL;
0c4a83f734cd - duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 118
diff changeset
1042 g_free(*buffer); *buffer = NULL;
115
7d0dd0e1dbd0 very preliminary twitter API get status feature.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 113
diff changeset
1043 }
7d0dd0e1dbd0 very preliminary twitter API get status feature.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 113
diff changeset
1044
37
bafe2abf2d3b - made suppress oops configurable
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 36
diff changeset
1045 if(!suppress_oops || !purple_prefs_get_bool(OPT_SUPPRESS_OOPS))
36
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1046 return FALSE;
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1047
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1048 if(strstr(*buffer, OOPS_MESSAGE)) {
39
2ac81c0afb53 - new debug macro. it includes function name and line number.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 38
diff changeset
1049 twitter_debug("clearing sender and buffer\n");
65
4949d4eb34ec - revised store icon feature
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 64
diff changeset
1050 g_free(*sender); *sender = NULL;
4949d4eb34ec - revised store icon feature
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 64
diff changeset
1051 g_free(*buffer); *buffer = NULL;
36
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1052 suppress_oops = FALSE;
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1053 }
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1054 return FALSE;
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1055 }
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1056
78
0b93dd0e0de1 fixed the data structure of marks that are positions of inserting user's icons.
mikanbako <maoutwo@gmail.com>
parents: 76
diff changeset
1057
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1058 static gboolean
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1059 displaying_im_cb(PurpleAccount *account, const char *who, char **message,
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1060 PurpleConversation *conv, PurpleMessageFlags flags,
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1061 void *unused)
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1062 {
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1063 GtkIMHtml *imhtml;
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1064 GtkTextBuffer *text_buffer;
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1065 gint service = get_service_type(conv);
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1066 gint linenumber = 0;
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1067
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1068 twitter_debug("called\n");
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1069
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1070 if(service == unknown_service) {
222
b168502b73c3 expanded size of substitution buffer to 32KB. 128 bytes were not sufficient if both user name and channel name are rather long. tenforward reported this problem and umq pointed out the cause.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 221
diff changeset
1071 twitter_debug("neither twitter nor wassr conv\n");
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1072 return FALSE;
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1073 }
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1074
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1075 /* get text buffer */
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1076 imhtml = GTK_IMHTML(PIDGIN_CONVERSATION(conv)->imhtml);
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1077 text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml));
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1078
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1079 /* store number of lines */
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1080 linenumber = gtk_text_buffer_get_line_count(text_buffer);
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1081 g_hash_table_insert(conv_hash, conv, GINT_TO_POINTER(linenumber));
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1082 twitter_debug("conv = %p linenumber = %d\n", conv, linenumber);
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1083
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1084 return FALSE;
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1085 }
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1086
78
0b93dd0e0de1 fixed the data structure of marks that are positions of inserting user's icons.
mikanbako <maoutwo@gmail.com>
parents: 76
diff changeset
1087 static void
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1088 displayed_im_cb(PurpleAccount *account, const char *who, char *message,
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1089 PurpleConversation *conv, PurpleMessageFlags flags)
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1090 {
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1091 GMatchInfo *match_info = NULL;
70
74524f379440 trying simple search in insert_requested_icon() due to malfunction under linux environment.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 69
diff changeset
1092 gchar *user_name = NULL;
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1093 GtkIMHtml *imhtml;
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1094 GtkTextBuffer *text_buffer;
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1095 GtkTextIter insertion_point;
86
89f52081f115 replaced int with gint
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 85
diff changeset
1096 gint service = get_service_type(conv);
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1097 icon_data *data = NULL;
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1098 gint linenumber;
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1099 GHashTable *hash = NULL;
152
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1100 gboolean renew = FALSE;
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1101
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1102 twitter_debug("called\n");
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1103
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1104 if(service == unknown_service) {
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1105 twitter_debug("unknown service\n");
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1106 return;
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1107 }
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1108
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1109 /* get user's name */
226
8da85ae0aa2c tweaked user pattern and channel pattern so that they can be matched regardless of surrounding anchor markups.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 223
diff changeset
1110 g_regex_match(regp[USER], message, 0, &match_info);
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1111 if(!g_match_info_matches(match_info)) {
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1112 twitter_debug("message was not matched : %s\n", message);
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1113 g_match_info_free(match_info);
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1114 return;
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1115 }
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1116
61
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1117 user_name = g_match_info_fetch(match_info, 1);
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1118 g_match_info_free(match_info);
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1119
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1120 /* insert icon */
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1121 imhtml = GTK_IMHTML(PIDGIN_CONVERSATION(conv)->imhtml);
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1122 text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml));
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1123
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1124 /* get GtkTextIter in the target line */
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1125 linenumber = GPOINTER_TO_INT(g_hash_table_lookup(conv_hash, conv));
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1126 gtk_text_buffer_get_iter_at_line(text_buffer,
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1127 &insertion_point,
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1128 linenumber);
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1129
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1130 switch(service) {
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1131 case twitter_service:
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1132 case wassr_service:
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1133 case identica_service:
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
1134 case jisko_service:
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
1135 case ffeed_service:
262
e9a7c018a952 reduce redundancy
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 261
diff changeset
1136 hash = icon_hash[service];
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
1137 break;
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1138 default:
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1139 twitter_debug("unknown service\n");
85
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1140 break;
fb9831fae969 - fixed the bug that icons didn't appear correctly for wassr conversation.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 84
diff changeset
1141 }
84
0c1f63882b8a preliminary wassr icon support. not yet completed.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 83
diff changeset
1142
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1143 if(hash)
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1144 data = g_hash_table_lookup(hash, user_name);
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1145
152
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1146 if(data) {
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1147 /* check validity of icon */
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1148 int count_thres = purple_prefs_get_int(OPT_ICON_MAX_COUNT);
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1149 int days_thres =
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1150 DAYS_TO_SECONDS(purple_prefs_get_int(OPT_ICON_MAX_DAYS));
152
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1151
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1152 if(data->use_count > count_thres ||
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1153 (data->mtime && ((time(NULL) - data->mtime)) > days_thres)) {
167
10516b7b05a9 - ceased use of purple_imgstore_*
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 166
diff changeset
1154 twitter_debug("count=%d mtime=%d\n",
10516b7b05a9 - ceased use of purple_imgstore_*
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 166
diff changeset
1155 data->use_count, (int)(data->mtime));
152
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1156 renew = TRUE;
198
85484ddf8823 - changed the way of fetching icons for wassr. now pidgin-twitter downloads html first even for wassr.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 196
diff changeset
1157 request_icon(user_name, service, renew);
152
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1158 }
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1159 }
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1160
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1161 /* if we don't have the icon for this user, put a mark instead and
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1162 * request the icon */
167
10516b7b05a9 - ceased use of purple_imgstore_*
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 166
diff changeset
1163 if(!data || !data->pixbuf) {
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1164 twitter_debug("%s's icon is not in memory.\n", user_name);
78
0b93dd0e0de1 fixed the data structure of marks that are positions of inserting user's icons.
mikanbako <maoutwo@gmail.com>
parents: 76
diff changeset
1165 mark_icon_for_user(gtk_text_buffer_create_mark(
95
ab612180e7d0 - added identica support. linkfy and character counter work. icon support has not implemented yet.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 94
diff changeset
1166 text_buffer, NULL, &insertion_point, FALSE),
84
0c1f63882b8a preliminary wassr icon support. not yet completed.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 83
diff changeset
1167 user_name, service);
78
0b93dd0e0de1 fixed the data structure of marks that are positions of inserting user's icons.
mikanbako <maoutwo@gmail.com>
parents: 76
diff changeset
1168 /* request to attach icon to the buffer */
152
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1169 request_icon(user_name, service, renew);
70
74524f379440 trying simple search in insert_requested_icon() due to malfunction under linux environment.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 69
diff changeset
1170 g_free(user_name); user_name = NULL;
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1171 return;
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1172 }
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1173
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1174 /* if we have the icon for this user, insert the icon immediately */
104
084e1c6de8ca icon scaling feature has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 103
diff changeset
1175 if(purple_prefs_get_bool(OPT_SHOW_ICON)) {
084e1c6de8ca icon scaling feature has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 103
diff changeset
1176 gtk_text_buffer_insert_pixbuf(text_buffer,
084e1c6de8ca icon scaling feature has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 103
diff changeset
1177 &insertion_point,
167
10516b7b05a9 - ceased use of purple_imgstore_*
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 166
diff changeset
1178 data->pixbuf);
152
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1179 data->use_count++;
104
084e1c6de8ca icon scaling feature has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 103
diff changeset
1180 }
70
74524f379440 trying simple search in insert_requested_icon() due to malfunction under linux environment.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 69
diff changeset
1181 g_free(user_name); user_name = NULL;
72
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
1182
af4f31bce461 Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 71
diff changeset
1183 twitter_debug("reach end of function\n");
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1184 }
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1185
36
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1186 static gboolean
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1187 pt_url_clicked_cb(GtkIMHtml *imhtml, GtkIMHtmlLink *link)
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1188 {
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1189 const gchar * url = gtk_imhtml_link_get_url(link);
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1190
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1191 purple_got_protocol_handler_uri(url);
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1192
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1193 return TRUE;
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1194 }
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1195
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1196 static gboolean
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1197 pt_url_context_menu_cb(GtkIMHtml *imhtml, GtkIMHtmlLink *link, GtkWidget *menu)
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1198 {
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1199 return TRUE;
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1200 }
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1201
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1202 static gboolean
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
1203 load_plugin(PurplePlugin *plugin)
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1204 {
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1205 int i;
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1206
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1207 /* connect to signal */
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1208 purple_signal_connect(purple_conversations_get_handle(),
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1209 "writing-im-msg",
19
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
1210 plugin, PURPLE_CALLBACK(writing_im_cb), NULL);
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1211 purple_signal_connect(purple_conversations_get_handle(),
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1212 "sending-im-msg",
19
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
1213 plugin, PURPLE_CALLBACK(sending_im_cb), NULL);
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
1214 purple_signal_connect(purple_conversations_get_handle(),
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1215 "conversation-created",
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1216 plugin, PURPLE_CALLBACK(conv_created_cb), NULL);
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1217 purple_signal_connect(purple_conversations_get_handle(),
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1218 "receiving-im-msg",
36
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1219 plugin, PURPLE_CALLBACK(receiving_im_cb), NULL);
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1220 purple_signal_connect(pidgin_conversations_get_handle(),
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1221 "displaying-im-msg",
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1222 plugin, PURPLE_CALLBACK(displaying_im_cb), NULL);
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1223
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1224 purple_signal_connect(pidgin_conversations_get_handle(),
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1225 "displayed-im-msg",
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1226 plugin, PURPLE_CALLBACK(displayed_im_cb), NULL);
61
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1227 purple_signal_connect(purple_conversations_get_handle(),
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1228 "deleting-conversation",
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1229 plugin, PURPLE_CALLBACK(deleting_conv_cb), NULL);
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1230 purple_signal_connect(purple_connections_get_handle(),
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1231 "signed-on",
118
8b097fcb9243 Add function that opens twitter's conversation window automatically when the
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 117
diff changeset
1232 plugin, PURPLE_CALLBACK(signed_on_cb), NULL);
8b097fcb9243 Add function that opens twitter's conversation window automatically when the
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 117
diff changeset
1233
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1234 gtk_imhtml_class_register_protocol("PT://",
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1235 pt_url_clicked_cb,
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1236 pt_url_context_menu_cb);
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1237 purple_signal_connect(purple_get_core(),
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1238 "uri-handler",
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1239 plugin,
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1240 PURPLE_CALLBACK(pt_uri_handler), NULL);
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1241
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1242
28
73e817be3267 - Fixed a crash bug. Each unload/reload cycle caused crash due to unrefed regp.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 25
diff changeset
1243 /* compile regex */
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
1244 regp[RECIPIENT] = g_regex_new(P_RECIPIENT, 0, 0, NULL);
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
1245 regp[SENDER] = g_regex_new(P_SENDER, 0, 0, NULL);
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
1246 regp[SENDER_FFEED] = g_regex_new(P_SENDER_FFEED, 0, 0, NULL);
45
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
1247 regp[COMMAND] = g_regex_new(P_COMMAND, G_REGEX_RAW, 0, NULL);
746ff3b54c10 trying another way to strip markups. in this revision, all markups are striped with strip_html_markup() on sending a message.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 44
diff changeset
1248 regp[PSEUDO] = g_regex_new(P_PSEUDO, G_REGEX_RAW, 0, NULL);
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1249 regp[USER] = g_regex_new(P_USER, 0, 0, NULL);
203
6c6fe6375ce4 revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 202
diff changeset
1250 regp[CHANNEL_WASSR] = g_regex_new(P_CHANNEL, 0, 0, NULL);
336
8de140bc8d13 better handling of non-ascii tag. now it properly handles tags in which the first ascii latter occurs in the beginning or mid of a non-ascii word.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 334
diff changeset
1251 regp[TAG_TWITTER] = g_regex_new(P_TAG_TWITTER, G_REGEX_RAW, 0, NULL);
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
1252 regp[TAG_IDENTICA] = g_regex_new(P_TAG_IDENTICA, 0, 0, NULL);
286
6d0bb66fedc7 added group support for identi.ca.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 284
diff changeset
1253 regp[GROUP_IDENTICA] = g_regex_new(P_GROUP_IDENTICA, 0, 0, NULL);
198
85484ddf8823 - changed the way of fetching icons for wassr. now pidgin-twitter downloads html first even for wassr.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 196
diff changeset
1254 regp[IMAGE_TWITTER] = g_regex_new(P_IMAGE_TWITTER, 0, 0, NULL);
85484ddf8823 - changed the way of fetching icons for wassr. now pidgin-twitter downloads html first even for wassr.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 196
diff changeset
1255 regp[IMAGE_WASSR] = g_regex_new(P_IMAGE_WASSR, 0, 0, NULL);
134
9e80267fe566 - changed the way of retrieving icons from twitter. now pidgin-twitter retrieves icon which is embedded in user page.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 130
diff changeset
1256 regp[IMAGE_IDENTICA] = g_regex_new(P_IMAGE_IDENTICA, 0, 0, NULL);
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
1257 regp[IMAGE_JISKO] = g_regex_new(P_IMAGE_JISKO, 0, 0, NULL);
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
1258 regp[IMAGE_FFEED] = g_regex_new(P_IMAGE_FFEED, 0, 0, NULL);
205
bc1448e72b1b workaround for that wassr sometimes provides 128 pixel icon with broad white borders.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 204
diff changeset
1259 regp[SIZE_128_WASSR] = g_regex_new(P_SIZE_128_WASSR, 0, 0, NULL);
239
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
1260 regp[EXCESS_LF] = g_regex_new(P_EXCESS_LF, 0, 0, NULL);
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
1261 regp[TRAIL_HASH] = g_regex_new(P_TRAIL_HASH, 0, 0, NULL);
347
33d2551727ba embed "in reply to foo" link to each reply message
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 345
diff changeset
1262 regp[PTTAG_TWITTER] = g_regex_new(P_PTTAG_TWITTER, 0, 0, NULL);
97
24ad534e438e linkfy #channelname per user configuration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
1263
194
1495b478680b tentative support for jisko.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 183
diff changeset
1264 for(i = twitter_service; i < NUM_SERVICES; i++) {
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1265 icon_hash[i] = g_hash_table_new_full(g_str_hash, g_str_equal,
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1266 g_free, NULL);
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1267 }
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1268
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1269 conv_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal,
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1270 NULL, NULL);
28
73e817be3267 - Fixed a crash bug. Each unload/reload cycle caused crash due to unrefed regp.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 25
diff changeset
1271
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1272
37
bafe2abf2d3b - made suppress oops configurable
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 36
diff changeset
1273 /* attach counter to the existing twitter window */
51
d5f251b37f6b - make sure that disabling markup widgets works even if counter is disabled.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 50
diff changeset
1274 if(purple_prefs_get_bool(OPT_COUNTER)) {
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1275 attach_to_window();
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1276 }
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1277
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1278 return TRUE;
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1279 }
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1280
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1281 static void
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1282 cancel_fetch_func(gpointer key, gpointer value, gpointer user_data)
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1283 {
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1284 icon_data *data = (icon_data *)value;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1285
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1286 if(!data)
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1287 return;
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1288
227
ed227c5765a2 fix for a problem that cancel_fetch_func() sometimes triggered double free caused by a design flaw in purple_proxy_connect_*().
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 226
diff changeset
1289 if(data->requested) {
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1290 purple_util_fetch_url_cancel(data->fetch_data);
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1291 data->fetch_data = NULL;
227
ed227c5765a2 fix for a problem that cancel_fetch_func() sometimes triggered double free caused by a design flaw in purple_proxy_connect_*().
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 226
diff changeset
1292 data->requested = FALSE;
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1293 }
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1294
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1295 if(data->request_list) {
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1296 twitter_debug("somehow, request_list != NULL\n");
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1297 }
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1298 }
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1299
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1300 static void
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1301 cleanup_hash_entry_func(gpointer key, gpointer value, gpointer user_data)
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1302 {
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1303 remove_marks_func(key, value, user_data);
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1304 cancel_fetch_func(key, value, user_data);
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1305 }
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1306
8
2c7c9eb4cdda added soundid selector
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 7
diff changeset
1307 static gboolean
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
1308 unload_plugin(PurplePlugin *plugin)
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1309 {
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1310 int i;
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1311 GList *current;
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1312
39
2ac81c0afb53 - new debug macro. it includes function name and line number.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 38
diff changeset
1313 twitter_debug("called\n");
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1314
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1315 /* disconnect from signal */
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1316 purple_signal_disconnect(purple_conversations_get_handle(),
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1317 "writing-im-msg",
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1318 plugin, PURPLE_CALLBACK(writing_im_cb));
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1319 purple_signal_disconnect(purple_conversations_get_handle(),
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1320 "sending-im-msg",
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1321 plugin, PURPLE_CALLBACK(sending_im_cb));
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
1322 purple_signal_disconnect(purple_conversations_get_handle(),
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1323 "conversation-created",
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1324 plugin, PURPLE_CALLBACK(conv_created_cb));
61
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1325 purple_signal_disconnect(pidgin_conversations_get_handle(),
135
cae8d5dd24d0 disconnect displaying_im_cb when unload.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 134
diff changeset
1326 "displaying-im-msg",
cae8d5dd24d0 disconnect displaying_im_cb when unload.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 134
diff changeset
1327 plugin, PURPLE_CALLBACK(displaying_im_cb));
cae8d5dd24d0 disconnect displaying_im_cb when unload.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 134
diff changeset
1328 purple_signal_disconnect(pidgin_conversations_get_handle(),
61
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1329 "displayed-im-msg",
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1330 plugin, PURPLE_CALLBACK(displayed_im_cb));
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1331 purple_signal_disconnect(purple_conversations_get_handle(),
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1332 "receiving-im-msg",
a44d15cfd8a2 trying to fix changeset 60:ddd164e74312: clash when a message received and this plugin loaded after unloaded
mikanbako <maoutwo@gmail.com>
parents: 60
diff changeset
1333 plugin, PURPLE_CALLBACK(receiving_im_cb));
36
ae1d059fa6fe added oops message suppression functionality. it discards oops message if a sent message is more than 140 bytes and less than 140 letters.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 35
diff changeset
1334 purple_signal_disconnect(purple_conversations_get_handle(),
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1335 "deleting-conversation",
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1336 plugin, PURPLE_CALLBACK(deleting_conv_cb));
259
d45dd3589560 little clean up
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 258
diff changeset
1337 purple_signal_disconnect(purple_connections_get_handle(),
118
8b097fcb9243 Add function that opens twitter's conversation window automatically when the
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 117
diff changeset
1338 "signed-on",
8b097fcb9243 Add function that opens twitter's conversation window automatically when the
Konosuke Watanabe <sasugaanija@gmail.com>
parents: 117
diff changeset
1339 plugin, PURPLE_CALLBACK(signed_on_cb));
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1340
330
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1341 gtk_imhtml_class_register_protocol("PT://", NULL, NULL);
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1342
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1343 /* should do? --yaz */
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1344 purple_signal_disconnect(purple_get_core(),
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1345 "uri-handler",
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1346 plugin, PURPLE_CALLBACK(pt_uri_handler));
cc41ee1f5d3a implemented reply, favorite, retweet functionalities. these are quite raw, be careful!
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 326
diff changeset
1347
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1348 /* unreference regp */
196
b436d72447e8 make use of got_page_cb to obtain icons for jisko.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 194
diff changeset
1349 for(i = 0; i < NUM_REGPS; i++) {
122
a37dd74c8355 - adapted to identi.ca changes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 121
diff changeset
1350 g_regex_unref(regp[i]);
a37dd74c8355 - adapted to identi.ca changes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 121
diff changeset
1351 }
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1352
80
e0bf37c105eb work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 79
diff changeset
1353 /* remove mark list in each hash entry */
60
ddd164e74312 trying to show user's icon. in this revision, the default icon of twitter is showed.
mikanbako <maoutwo@gmail.com>
parents: 59
diff changeset
1354 /* cancel request that has not been finished yet */
194
1495b478680b tentative support for jisko.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 183
diff changeset
1355 for(i = twitter_service; i < NUM_SERVICES; i++) {
148
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1356 /* delete mark list and stop requeset for each hash table */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1357 g_hash_table_foreach(icon_hash[i],
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1358 (GHFunc)cleanup_hash_entry_func, NULL);
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1359 /* destroy hash table for icon_data */
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1360 g_hash_table_destroy(icon_hash[i]);
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1361 }
4e9d0fd93fb6 - in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 147
diff changeset
1362
94
31cddb2c2acc fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 93
diff changeset
1363 g_hash_table_destroy(conv_hash);
9
c6b80f47d4df added capability to translate sender name into link
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 8
diff changeset
1364
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1365 /* detach from twitter window */
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1366 detach_from_window();
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1367
220
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1368 /* free wassr_parrot_list */
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1369 current = g_list_first(wassr_parrot_list);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1370 while(current) {
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1371 GList *next;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1372
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1373 next = g_list_next(current);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1374 g_free(current->data);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1375 wassr_parrot_list =
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1376 g_list_delete_link(wassr_parrot_list, current);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1377
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1378 current = next;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1379 }
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1380 g_list_free(wassr_parrot_list);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1381 wassr_parrot_list = NULL;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1382
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1383 /* free identica_parot_list */
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1384 current = g_list_first(identica_parrot_list);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1385 while(current) {
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1386 GList *next;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1387
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1388 next = g_list_next(current);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1389 g_free(current->data);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1390 identica_parrot_list =
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1391 g_list_delete_link(identica_parrot_list, current);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1392
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1393 current = next;
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1394 }
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1395 g_list_free(identica_parrot_list);
1ebef23bbccb - made parrot buffers lists so that delayed echo back message can be properly blocked.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 219
diff changeset
1396 identica_parrot_list = NULL;
138
eaf5d2c4ada0 temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 137
diff changeset
1397
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1398 return TRUE;
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1399 }
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1400
126
bac987852e66 switched to native gtk preferences dialog.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 125
diff changeset
1401 static PidginPluginUiInfo ui_info = {
bac987852e66 switched to native gtk preferences dialog.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 125
diff changeset
1402 prefs_get_frame,
256
9fb8f597adf3 - moved is_*_account() functions to util.c.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 254
diff changeset
1403 0, /* page number - reserved */
9fb8f597adf3 - moved is_*_account() functions to util.c.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 254
diff changeset
1404 NULL, /* reserved 1 */
9fb8f597adf3 - moved is_*_account() functions to util.c.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 254
diff changeset
1405 NULL, /* reserved 2 */
9fb8f597adf3 - moved is_*_account() functions to util.c.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 254
diff changeset
1406 NULL, /* reserved 3 */
9fb8f597adf3 - moved is_*_account() functions to util.c.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 254
diff changeset
1407 NULL /* reserved 4 */
126
bac987852e66 switched to native gtk preferences dialog.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 125
diff changeset
1408 };
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1409
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1410 static PurplePluginInfo info = {
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1411 PURPLE_PLUGIN_MAGIC,
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1412 PURPLE_MAJOR_VERSION,
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1413 PURPLE_MINOR_VERSION,
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1414 PURPLE_PLUGIN_STANDARD, /**< type */
147
3abee459c81c removed old prefs stuff.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 146
diff changeset
1415 PIDGIN_PLUGIN_TYPE, /**< ui_req */
19
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
1416 0, /**< flags */
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
1417 NULL, /**< deps */
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1418 PURPLE_PRIORITY_DEFAULT, /**< priority */
232
1c85aa4acb9d - bumped version to 0.8.0b1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 231
diff changeset
1419 PLUGIN_ID, /**< id */
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1420 "Pidgin-Twitter", /**< name */
363
85e109dee063 - version bump to 0.9.2.1
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 362
diff changeset
1421 "0.9.2.1", /**< version */
76
63bd9ca28be0 - added nosuke and iratqq to the authors.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 74
diff changeset
1422 "provides useful features for twitter", /** summary */
63bd9ca28be0 - added nosuke and iratqq to the authors.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 74
diff changeset
1423 "provides useful features for twitter", /** desc */
363
85e109dee063 - version bump to 0.9.2.1
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 362
diff changeset
1424 "Yoshiki Yazawa, mikanbako, \nKonosuke Watanabe, IWATA Ray, \nmojin, umq, dai, \nthe pidging-twitter team", /**< author */
164
5043d4d9766d clean up.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents: 162
diff changeset
1425 "http://www.honeyplanet.jp/pidgin-twitter/", /**< homepage */
19
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
1426 load_plugin, /**< load */
0d7cbc984570 escape pseudo command feature has been added
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 16
diff changeset
1427 unload_plugin, /**< unload */
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1428 NULL, /**< destroy */
269
ac9b8dc3b013 bump version to 0.8.2
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 268
diff changeset
1429 &ui_info, /**< ui_info */
126
bac987852e66 switched to native gtk preferences dialog.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 125
diff changeset
1430 NULL, /**< extra_info */
bac987852e66 switched to native gtk preferences dialog.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 125
diff changeset
1431 NULL, /**< pref info */
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1432 NULL
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1433 };
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1434
8
2c7c9eb4cdda added soundid selector
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 7
diff changeset
1435 static void
38
625e385036c3 applied indent to fix indentations
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 37
diff changeset
1436 init_plugin(PurplePlugin *plugin)
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1437 {
64
da37857f3033 - separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 63
diff changeset
1438 char *dirname = NULL;
da37857f3033 - separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 63
diff changeset
1439
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1440 g_type_init();
67
000575bce35d path should not be hard-coded. windows uses another delimiter.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 66
diff changeset
1441 dirname = g_build_filename(purple_user_dir(), "pidgin-twitter", "icons", NULL);
64
da37857f3033 - separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 63
diff changeset
1442 if(dirname)
da37857f3033 - separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 63
diff changeset
1443 purple_prefs_add_string(OPT_ICON_DIR, dirname);
da37857f3033 - separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 63
diff changeset
1444 g_free(dirname);
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1445
6
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1446 /* add plugin preferences */
ca8f95431962 fixed indentation
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 5
diff changeset
1447 purple_prefs_add_none(OPT_PIDGINTWITTER);
9
c6b80f47d4df added capability to translate sender name into link
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 8
diff changeset
1448 purple_prefs_add_bool(OPT_TRANSLATE_RECIPIENT, TRUE);
c6b80f47d4df added capability to translate sender name into link
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 8
diff changeset
1449 purple_prefs_add_bool(OPT_TRANSLATE_SENDER, TRUE);
97
24ad534e438e linkfy #channelname per user configuration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 96
diff changeset
1450 purple_prefs_add_bool(OPT_TRANSLATE_CHANNEL, TRUE);
359
7f86a9f04c26 do not escape pseudo command by default.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 356
diff changeset
1451 purple_prefs_add_bool(OPT_ESCAPE_PSEUDO, FALSE);
239
e3a24c98772d added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 232
diff changeset
1452 purple_prefs_add_bool(OPT_STRIP_EXCESS_LF, TRUE);
9
c6b80f47d4df added capability to translate sender name into link
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 8
diff changeset
1453
10
4bd8c89b4749 now it plays sound when sender of message is in the userlist.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 9
diff changeset
1454 purple_prefs_add_bool(OPT_PLAYSOUND_RECIPIENT, TRUE);
15
6be35fe9d18c changed default value of playsound for sender. now it is enabled by default.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 14
diff changeset
1455 purple_prefs_add_bool(OPT_PLAYSOUND_SENDER, TRUE);
11
7ea2a717af42 now sender list and sender sound can be set in independent of recipient settings.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 10
diff changeset
1456 purple_prefs_add_int(OPT_SOUNDID_RECIPIENT, PURPLE_SOUND_POUNCE_DEFAULT);
7ea2a717af42 now sender list and sender sound can be set in independent of recipient settings.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 10
diff changeset
1457 purple_prefs_add_string(OPT_USERLIST_RECIPIENT, DEFAULT_LIST);
16
728c068534d1 default soundid for sender has been changed to pounce default since anything other may be disabled by configuration so that it may be confusing.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 15
diff changeset
1458 purple_prefs_add_int(OPT_SOUNDID_SENDER, PURPLE_SOUND_POUNCE_DEFAULT);
11
7ea2a717af42 now sender list and sender sound can be set in independent of recipient settings.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 10
diff changeset
1459 purple_prefs_add_string(OPT_USERLIST_SENDER, DEFAULT_LIST);
31
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1460
312a745dece6 added letter counter
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 30
diff changeset
1461 purple_prefs_add_bool(OPT_COUNTER, TRUE);
37
bafe2abf2d3b - made suppress oops configurable
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 36
diff changeset
1462 purple_prefs_add_bool(OPT_SUPPRESS_OOPS, TRUE);
99
f207cc8da6cd quick hack to make show icon configurable
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 98
diff changeset
1463 purple_prefs_add_bool(OPT_PREVENT_NOTIFICATION, FALSE);
59
3f9148c1dc60 added that to prevent notifications of incoming messages from twitter.com.
mikanbako <maoutwo@gmail.com>
parents: 56
diff changeset
1464
258
2145f975ef69 - fixed a glitch in identi.ca icon pattern
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 256
diff changeset
1465 purple_prefs_add_bool(OPT_API_BASE_POST, TRUE);
153
07cedffb1c63 implemented UI for configuring icon update.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 152
diff changeset
1466 purple_prefs_add_int(OPT_API_BASE_GET_INTERVAL, TWITTER_DEFAULT_INTERVAL);
284
2d559555875f now message count can be specified in twitter API access.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 274
diff changeset
1467 purple_prefs_add_int(OPT_RETRIEVE_COUNT, TWITTER_DEFAULT_RETRIEVE_COUNT);
110
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
1468 purple_prefs_add_string(OPT_SCREEN_NAME_TWITTER, EMPTY);
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
1469 purple_prefs_add_string(OPT_PASSWORD_TWITTER, EMPTY);
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
1470 purple_prefs_add_string(OPT_SCREEN_NAME_WASSR, EMPTY);
8b98a26f44ce made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 109
diff changeset
1471 purple_prefs_add_string(OPT_SCREEN_NAME_IDENTICA, EMPTY);
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
1472 purple_prefs_add_string(OPT_SCREEN_NAME_JISKO, EMPTY);
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
1473 purple_prefs_add_string(OPT_SCREEN_NAME_FFEED, EMPTY);
153
07cedffb1c63 implemented UI for configuring icon update.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 152
diff changeset
1474
07cedffb1c63 implemented UI for configuring icon update.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 152
diff changeset
1475 purple_prefs_add_bool(OPT_SHOW_ICON, TRUE);
07cedffb1c63 implemented UI for configuring icon update.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 152
diff changeset
1476 purple_prefs_add_int(OPT_ICON_SIZE, DEFAULT_ICON_SIZE);
07cedffb1c63 implemented UI for configuring icon update.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 152
diff changeset
1477 purple_prefs_add_bool(OPT_UPDATE_ICON, TRUE);
152
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1478 purple_prefs_add_int(OPT_ICON_MAX_COUNT, DEFAULT_ICON_MAX_COUNT);
588da540685a work in progress icon update feature. the default thresholds have been set to 5 times or 1 day for testing.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 151
diff changeset
1479 purple_prefs_add_int(OPT_ICON_MAX_DAYS, DEFAULT_ICON_MAX_DAYS);
168
56e3873e58a8 made log output configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 167
diff changeset
1480 purple_prefs_add_bool(OPT_LOG_OUTPUT, FALSE);
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1481
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1482 purple_prefs_add_bool(OPT_FILTER, TRUE);
215
6b258bdd9c49 added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 214
diff changeset
1483 purple_prefs_add_bool(OPT_FILTER_EXCLUDE_REPLY, TRUE);
211
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1484 purple_prefs_add_string(OPT_FILTER_TWITTER, DEFAULT_LIST);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1485 purple_prefs_add_string(OPT_FILTER_WASSR, DEFAULT_LIST);
e13103257b33 implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 210
diff changeset
1486 purple_prefs_add_string(OPT_FILTER_IDENTICA, DEFAULT_LIST);
240
405f8b880142 restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 239
diff changeset
1487 purple_prefs_add_string(OPT_FILTER_JISKO, DEFAULT_LIST);
300
42cdddf0f747 added preliminary support for friendfeed.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 299
diff changeset
1488 purple_prefs_add_string(OPT_FILTER_FFEED, DEFAULT_LIST);
0
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1489 }
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1490
2413369d1b01 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1491 PURPLE_INIT_PLUGIN(pidgin_twitter, init_plugin, info)