Mercurial > pidgin-twitter
annotate pidgin-twitter.h @ 240:405f8b880142
restored jisko support.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Tue, 07 Oct 2008 16:44:02 +0900 |
parents | e3a24c98772d |
children | bd7478109727 |
rev | line source |
---|---|
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
1 #ifndef _PIDGIN_TWITTER_H_ |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
2 #define _PIDGIN_TWITTER_H_ |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
3 |
122
a37dd74c8355
- adapted to identi.ca changes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
119
diff
changeset
|
4 #define _BSD_SOURCE |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
5 #define _XOPEN_SOURCE 600 |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
6 #include <stdio.h> |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
7 #include <stdlib.h> |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
8 #include <string.h> |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
9 #include <glib.h> |
159
b771ddf0b683
should remove old icon files when pidgin-twitter create new one.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
153
diff
changeset
|
10 #include <glib/gstdio.h> |
66
0ddcba9161fd
now local icon cache works
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
65
diff
changeset
|
11 #include <sys/stat.h> |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
12 #include <time.h> |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
13 #include <locale.h> |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
14 |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
15 #include <gdk-pixbuf/gdk-pixbuf.h> |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
16 #include <libxml/xmlreader.h> |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
17 |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
18 #include "gtkplugin.h" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
19 #include "util.h" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
20 #include "debug.h" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
21 #include "connection.h" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
22 #include "version.h" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
23 #include "sound.h" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
24 #include "gtkconv.h" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
25 #include "gtkimhtml.h" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
26 |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
27 /* regp id */ |
103
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
28 enum { |
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
29 RECIPIENT = 0, |
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
30 SENDER, |
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
31 COMMAND, |
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
32 PSEUDO, |
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
33 USER, |
203
6c6fe6375ce4
revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
202
diff
changeset
|
34 CHANNEL_WASSR, |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
35 TAG_IDENTICA, |
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
|
36 IMAGE_TWITTER, |
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
|
37 IMAGE_WASSR, |
203
6c6fe6375ce4
revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
202
diff
changeset
|
38 IMAGE_IDENTICA, |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
39 IMAGE_JISKO, |
239
e3a24c98772d
added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
231
diff
changeset
|
40 SIZE_128_WASSR, |
e3a24c98772d
added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
231
diff
changeset
|
41 EXCESS_LF |
103
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
42 }; |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
43 |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
44 /* service id */ |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
45 enum { |
148
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
46 unknown_service = -1, |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
47 twitter_service, |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
48 wassr_service, |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
49 identica_service, |
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
50 jisko_service |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
51 }; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
52 |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
53 /* container to hold icon data */ |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
54 typedef struct _icon_data { |
167
10516b7b05a9
- ceased use of purple_imgstore_*
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
165
diff
changeset
|
55 GdkPixbuf *pixbuf; /* icon pixmap */ |
148
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
56 gboolean requested; /* TRUE if download icon has been requested */ |
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
57 GList *request_list; /* marker list */ |
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
58 PurpleUtilFetchUrlData *fetch_data; /* icon fetch data */ |
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
59 const gchar *img_type; /* image type */ |
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
|
60 gchar *icon_url; /* url for the user's icon */ |
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:
148
diff
changeset
|
61 gint use_count; /* usage 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:
148
diff
changeset
|
62 time_t mtime; /* mtime of file */ |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
63 } icon_data; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
64 |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
65 /* used by got_icon_cb */ |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
66 typedef struct _got_icon_data { |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
67 gchar *user_name; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
68 gint service; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
69 } got_icon_data; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
70 |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
71 /* used by eval */ |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
72 typedef struct _eval_data { |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
73 gint which; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
74 gint service; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
75 } eval_data; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
76 |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
77 /* container for api based retrieve */ |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
78 typedef struct _status { |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
79 gchar *created_at; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
80 gchar *text; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
81 gchar *screen_name; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
82 gchar *profile_image_url; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
83 time_t time; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
84 guint id; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
85 } status_t; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
86 |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
87 /* container for api based post */ |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
88 typedef struct twitter_message { |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
89 PurpleAccount *account; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
90 char *status; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
91 time_t time; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
92 } twitter_message_t; |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
93 |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
94 #define PLUGIN_ID "gtk-honeyplanet-pidgin_twitter" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
95 #define PLUGIN_NAME "pidgin-twitter" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
96 |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
97 /* options */ |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
98 #define OPT_PIDGINTWITTER "/plugins/pidgin_twitter" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
99 #define OPT_TRANSLATE_RECIPIENT OPT_PIDGINTWITTER "/translate_recipient" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
100 #define OPT_TRANSLATE_SENDER OPT_PIDGINTWITTER "/translate_sender" |
97
24ad534e438e
linkfy #channelname per user configuration.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
95
diff
changeset
|
101 #define OPT_TRANSLATE_CHANNEL OPT_PIDGINTWITTER "/translate_channel" |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
102 #define OPT_PLAYSOUND_RECIPIENT OPT_PIDGINTWITTER "/playsound_recipient" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
103 #define OPT_PLAYSOUND_SENDER OPT_PIDGINTWITTER "/playsound_sender" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
104 #define OPT_SOUNDID_RECIPIENT OPT_PIDGINTWITTER "/soundid_recipient" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
105 #define OPT_SOUNDID_SENDER OPT_PIDGINTWITTER "/soundid_sender" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
106 #define OPT_ESCAPE_PSEUDO OPT_PIDGINTWITTER "/escape_pseudo" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
107 #define OPT_USERLIST_RECIPIENT OPT_PIDGINTWITTER "/userlist_recipient" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
108 #define OPT_USERLIST_SENDER OPT_PIDGINTWITTER "/userlist_sender" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
109 #define OPT_COUNTER OPT_PIDGINTWITTER "/counter" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
110 #define OPT_SUPPRESS_OOPS OPT_PIDGINTWITTER "/suppress_oops" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
111 #define OPT_PREVENT_NOTIFICATION OPT_PIDGINTWITTER "/prevent_notification" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
112 #define OPT_ICON_DIR OPT_PIDGINTWITTER "/icon_dir" |
72
af4f31bce461
Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents:
69
diff
changeset
|
113 #define OPT_API_BASE_POST OPT_PIDGINTWITTER "/api_base_post" |
110
8b98a26f44ce
made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
107
diff
changeset
|
114 #define OPT_SCREEN_NAME_TWITTER OPT_PIDGINTWITTER "/screen_name_twitter" |
8b98a26f44ce
made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
107
diff
changeset
|
115 #define OPT_SCREEN_NAME_WASSR OPT_PIDGINTWITTER "/screen_name_wassr" |
8b98a26f44ce
made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
107
diff
changeset
|
116 #define OPT_SCREEN_NAME_IDENTICA OPT_PIDGINTWITTER "/screen_name_identica" |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
117 #define OPT_SCREEN_NAME_JISKO OPT_PIDGINTWITTER "/screen_name_jisko" |
110
8b98a26f44ce
made screen name for each service configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
107
diff
changeset
|
118 #define OPT_PASSWORD_TWITTER OPT_PIDGINTWITTER "/password_twitter" |
99
f207cc8da6cd
quick hack to make show icon configurable
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
98
diff
changeset
|
119 #define OPT_SHOW_ICON OPT_PIDGINTWITTER "/show_icon" |
107
eb77d409c235
- do neither save nor cache icon image if pixbuf can not be obtained.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
105
diff
changeset
|
120 #define OPT_ICON_SIZE OPT_PIDGINTWITTER "/icon_size" |
153
07cedffb1c63
implemented UI for configuring icon update.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
152
diff
changeset
|
121 #define OPT_UPDATE_ICON OPT_PIDGINTWITTER "/update_icon" |
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:
148
diff
changeset
|
122 #define OPT_ICON_MAX_COUNT OPT_PIDGINTWITTER "/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:
148
diff
changeset
|
123 #define OPT_ICON_MAX_DAYS OPT_PIDGINTWITTER "/icon_max_days" |
124
ec861f8a2268
- added new pref value for API based fetch interval.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
122
diff
changeset
|
124 #define OPT_API_BASE_GET_INTERVAL OPT_PIDGINTWITTER "/api_base_get_interval" |
168
56e3873e58a8
made log output configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
167
diff
changeset
|
125 #define OPT_LOG_OUTPUT OPT_PIDGINTWITTER "/log_output" |
211
e13103257b33
implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
209
diff
changeset
|
126 #define OPT_FILTER OPT_PIDGINTWITTER "/filter" |
215
6b258bdd9c49
added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
214
diff
changeset
|
127 #define OPT_FILTER_EXCLUDE_REPLY OPT_PIDGINTWITTER "/filter_exclude_reply" |
211
e13103257b33
implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
209
diff
changeset
|
128 #define OPT_FILTER_TWITTER OPT_PIDGINTWITTER "/filter_twitter" |
e13103257b33
implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
209
diff
changeset
|
129 #define OPT_FILTER_WASSR OPT_PIDGINTWITTER "/filter_wassr" |
e13103257b33
implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
209
diff
changeset
|
130 #define OPT_FILTER_IDENTICA OPT_PIDGINTWITTER "/filter_identica" |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
131 #define OPT_FILTER_JISKO OPT_PIDGINTWITTER "/filter_jisko" |
239
e3a24c98772d
added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
231
diff
changeset
|
132 #define OPT_STRIP_EXCESS_LF OPT_PIDGINTWITTER "/strip_excess_lf" |
215
6b258bdd9c49
added a feature of excluding reply to me from filter application.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
214
diff
changeset
|
133 |
214
148fa8a8be8e
- trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
211
diff
changeset
|
134 #ifdef _WIN32 |
148fa8a8be8e
- trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
211
diff
changeset
|
135 #define OPT_PIDGIN_BLINK_IM PIDGIN_PREFS_ROOT "/win32/blink_im" |
148fa8a8be8e
- trying a new way to suppress window blinking in WIN32
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
211
diff
changeset
|
136 #endif |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
137 |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
138 /* formats and templates */ |
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
|
139 #define RECIPIENT_FORMAT_TWITTER "%s@<a href='http://twitter.com/%s'>%s</a>" |
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
|
140 #define SENDER_FORMAT_TWITTER "%s<a href='http://twitter.com/%s'>%s</a>: " |
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
|
141 #define RECIPIENT_FORMAT_WASSR "%s@<a href='http://wassr.jp/user/%s'>%s</a>" |
82
c9600d64781a
work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
80
diff
changeset
|
142 #define SENDER_FORMAT_WASSR "%s<a href='http://wassr.jp/user/%s'>%s</a>: " |
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
|
143 #define RECIPIENT_FORMAT_IDENTICA "%s@<a href='http://identi.ca/%s'>%s</a>" |
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
|
144 #define SENDER_FORMAT_IDENTICA "%s<a href='http://identi.ca/%s'>%s</a>: " |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
145 #define RECIPIENT_FORMAT_JISKO "@<a href='http://jisko.net/%s'>%s</a>" |
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
146 #define SENDER_FORMAT_JISKO "%s<a href='http://jisko.net/%s'>%s</a>: " |
98
e460e1978ca3
- fixed a bug introduced in r97.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
97
diff
changeset
|
147 #define CHANNEL_FORMAT_WASSR "%s<a href='http://wassr.jp/channel/%s'>%s</a> " |
202
67d8eaba446d
preliminary identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
200
diff
changeset
|
148 #define CHANNEL_FORMAT_IDENTICA "%s<a href='http://identi.ca/tag/%s'>%s</a> " |
203
6c6fe6375ce4
revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
202
diff
changeset
|
149 #define TAG_FORMAT_IDENTICA "#<a href='http://identi.ca/tag/%s'>%s</a>" |
6c6fe6375ce4
revised identi.ca tag support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
202
diff
changeset
|
150 |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
151 #define DEFAULT_LIST "(list of users: separated with ' ,:;')" |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
152 #define OOPS_MESSAGE "<body>Oops! Your update was over 140 characters. We sent the short version to your friends (they can view the entire update on the web).<BR></body>" |
72
af4f31bce461
Support API base message posting
Konosuke Watanabe <sasugaanija@gmail.com>
parents:
69
diff
changeset
|
153 #define EMPTY "" |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
154 |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
155 /* patterns */ |
225
1ef5aa4883a1
adapted to the change of user name definition in wassr. now '-' can be included.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
224
diff
changeset
|
156 #define P_RECIPIENT "(^|\\s+|[.[:^print:]])@([-A-Za-z0-9_]+)" |
1ef5aa4883a1
adapted to the change of user name definition in wassr. now '-' can be included.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
224
diff
changeset
|
157 #define P_SENDER "^(\\r?\\n?)\\s*([-A-Za-z0-9_]+)(?:\\s*\\(.+\\))?: " |
103
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
158 #define P_COMMAND "^(?:\\s*)([dDfFgGlLmMnNtTwW]{1}\\s+[A-Za-z0-9_]+)(?:\\s*\\Z)" |
8de54d420328
added preliminary identi.ca icon support.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
99
diff
changeset
|
159 #define P_PSEUDO "^\\s*(?:[\"#$%&'()*+,\\-./:;<=>?\\[\\\\\\]_`{|}~]|[^\\s\\x21-\\x7E])*([dDfFgGlLmMnNtTwW]{1})(?:\\Z|\\s+|[^\\x21-\\x7E]+\\Z)" |
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:
225
diff
changeset
|
160 #define P_USER "^.*?(?:<a .+?>)?([-A-Za-z0-9_]+)(?:</a>)?:" |
8da85ae0aa2c
tweaked user pattern and channel pattern so that they can be matched regardless of surrounding anchor markups.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
225
diff
changeset
|
161 #define P_CHANNEL "^(.*?(?:<a .+?>)?[-A-Za-z0-9_]+(?:</a>)?: \\r?\\n?#)([A-Za-z0-9_]+) " |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
162 #define P_TAG_IDENTICA "#([-A-Za-z0-9_]+)" |
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
|
163 #define P_IMAGE_TWITTER "<a href=\"/account/profile_image/.+?\"><img .+? id=\"profile-image\".*src=\"(http://.+)\" .+?/>" |
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
|
164 #define P_IMAGE_WASSR "<div class=\"image\"><a href=\".+\"><img src=\"(.+)\" width=\".+?\" /></a></div>" |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
165 #define P_IMAGE_IDENTICA "<img src=\"(http://.+.identi.ca/.+)\" class=\"avatar profile\" width=\"96\" height=\"96\" alt=\"[A-Za-z0-0_]+\"/>" |
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
166 #define P_IMAGE_JISKO "<img src=\"(http://jisko.net/users/.+/img/avatar/thumb_side\\..+)\" alt=\"Avatar\" />" |
239
e3a24c98772d
added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
231
diff
changeset
|
167 #define P_SIZE_128_WASSR "\\.128\\." |
e3a24c98772d
added a new feature that strips excessive consecutive new line characters.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
231
diff
changeset
|
168 #define P_EXCESS_LF "([\\r|\\n]{3,})" |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
169 |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
170 /* twitter API specific macros */ |
124
ec861f8a2268
- added new pref value for API based fetch interval.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
122
diff
changeset
|
171 #define TWITTER_BASE_URL "http://twitter.com" |
161
5dcd8699cba0
added a workaround for posting via broken firewall, for example notorious "watchguard". if you got error code 400, try hidden prefs value "broken_firewall" be 1.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
160
diff
changeset
|
172 #define TWITTER_STATUS_GET "GET /statuses/friends_timeline.xml HTTP/1.1\r\n" \ |
124
ec861f8a2268
- added new pref value for API based fetch interval.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
122
diff
changeset
|
173 "Host: twitter.com\r\n" \ |
162
1237fc885a92
revised http request. "broken_firewall" no longre needed?
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
161
diff
changeset
|
174 "User-Agent: pidgin-twitter\r\n" \ |
124
ec861f8a2268
- added new pref value for API based fetch interval.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
122
diff
changeset
|
175 "Authorization: Basic %s\r\n" |
161
5dcd8699cba0
added a workaround for posting via broken firewall, for example notorious "watchguard". if you got error code 400, try hidden prefs value "broken_firewall" be 1.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
160
diff
changeset
|
176 #define TWITTER_STATUS_POST "POST /statuses/update.xml HTTP/1.1\r\n" \ |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
177 "Host: twitter.com\r\n" \ |
162
1237fc885a92
revised http request. "broken_firewall" no longre needed?
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
161
diff
changeset
|
178 "User-Agent: pidgin-twitter\r\n" \ |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
179 "Authorization: Basic %s\r\n" \ |
162
1237fc885a92
revised http request. "broken_firewall" no longre needed?
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
161
diff
changeset
|
180 "Content-Length: %d\r\n" |
165
ade632c88e33
we've got the official source value for pidgin-twitter.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
164
diff
changeset
|
181 #define TWITTER_STATUS_FORMAT "status=%s&source=pidgintwitter" |
138
eaf5d2c4ada0
temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
134
diff
changeset
|
182 #define TWITTER_DEFAULT_INTERVAL (60) |
160
aef26b56a54b
now it falls back to twitter default icon if the user has not set custom icon.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
159
diff
changeset
|
183 #define TWITTER_DEFAULT_ICON_URL "http://static.twitter.com/images/default_profile_bigger.png" |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
184 |
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:
219
diff
changeset
|
185 /* size of substitution buffer */ |
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:
219
diff
changeset
|
186 #define SUBST_BUF_SIZE (32 * 1024) |
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:
219
diff
changeset
|
187 |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
188 /* wassr specific macros */ |
209
d512d1d8712f
improved parrot blocker slightly.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
206
diff
changeset
|
189 #define WASSR_POST_LEN (255) |
138
eaf5d2c4ada0
temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
134
diff
changeset
|
190 #define IDENTICA_POST_LEN (140) |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
191 |
124
ec861f8a2268
- added new pref value for API based fetch interval.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
122
diff
changeset
|
192 /* misc macros */ |
138
eaf5d2c4ada0
temporal fix for identi.ca problems:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
134
diff
changeset
|
193 #define DEFAULT_ICON_SIZE (48) |
163
84cb6e8ad755
raise the default icon update threshold to 50 times or 7days.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
162
diff
changeset
|
194 #define DEFAULT_ICON_MAX_COUNT (50) |
84cb6e8ad755
raise the default icon update threshold to 50 times or 7days.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
162
diff
changeset
|
195 #define DEFAULT_ICON_MAX_DAYS (7) |
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:
148
diff
changeset
|
196 #define DAYS_TO_SECONDS(d) ((d) * 86400) |
124
ec861f8a2268
- added new pref value for API based fetch interval.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
122
diff
changeset
|
197 |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
198 /* debug macros */ |
168
56e3873e58a8
made log output configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
167
diff
changeset
|
199 #define twitter_debug(fmt, ...) do { if(purple_prefs_get_bool(OPT_LOG_OUTPUT)) purple_debug(PURPLE_DEBUG_INFO, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); } while(0); |
56e3873e58a8
made log output configurable.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
167
diff
changeset
|
200 #define twitter_error(fmt, ...) do { if(purple_prefs_get_bool(OPT_LOG_OUTPUT)) purple_debug(PURPLE_DEBUG_ERROR, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); } while(0); |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
201 |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
202 /* prototypes */ |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
203 static void escape(gchar **str); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
204 static gboolean sending_im_cb(PurpleAccount *account, char *recipient, char **buffer, void *data); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
205 static gboolean eval(const GMatchInfo *match_info, GString *result, gpointer user_data); |
86 | 206 static void translate(gchar **str, gint which, gint service); |
207 static void playsound(gchar **str, gint which); | |
91
2b7ef3538cd3
- Fix type of 'flag' of writing_im_cb
Konosuke Watanabe <sasugaanija@gmail.com>
parents:
85
diff
changeset
|
208 static gboolean writing_im_cb(PurpleAccount *account, char *sender, char **buffer, PurpleConversation *conv, int flags, void *data); |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
209 static void insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position, gchar *new_text, gint new_text_length, gpointer user_data); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
210 static void delete_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *start_pos, GtkTextIter *end_pos, gpointer user_data); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
211 static void detach_from_window(void); |
82
c9600d64781a
work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
80
diff
changeset
|
212 static void detach_from_conv(PurpleConversation *conv, gpointer null); |
84
0c1f63882b8a
preliminary wassr icon support. not yet completed.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
82
diff
changeset
|
213 static void delete_requested_icon_marks(PidginConversation *gtkconv, GHashTable *table); |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
214 static void attach_to_window(void); |
82
c9600d64781a
work in progress adaptation to wassr service. cleanups required:
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
80
diff
changeset
|
215 static void attach_to_conv(PurpleConversation *conv, gpointer null); |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
216 static gboolean is_twitter_account(PurpleAccount *account, const char *name); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
217 static gboolean is_twitter_conv(PurpleConversation *conv); |
74
6b9593d1ffed
quick hack to suppress annoying completion message from wassr.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
72
diff
changeset
|
218 static gboolean is_wassr_account(PurpleAccount *account, const char *name); |
6b9593d1ffed
quick hack to suppress annoying completion message from wassr.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
72
diff
changeset
|
219 static gboolean is_wassr_conv(PurpleConversation *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
|
220 static gboolean is_identica_account(PurpleAccount *account, const char *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
|
221 static gboolean is_identica_conv(PurpleConversation *conv); |
240
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
222 static gboolean is_jisko_account(PurpleAccount *account, const char *name); |
405f8b880142
restored jisko support.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
239
diff
changeset
|
223 static gboolean is_jisko_conv(PurpleConversation *conv); |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
224 static void conv_created_cb(PurpleConversation *conv, gpointer null); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
225 static void deleting_conv_cb(PurpleConversation *conv); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
226 static gboolean receiving_im_cb(PurpleAccount *account, char **sender, char **buffer, PurpleConversation *conv, PurpleMessageFlags *flags, void *data); |
84
0c1f63882b8a
preliminary wassr icon support. not yet completed.
Yoshiki Yazawa <yaz@honeyplnaet.jp>
parents:
82
diff
changeset
|
227 static void insert_icon_at_mark(GtkTextMark *requested_mark, gpointer user_data); |
86 | 228 static void insert_requested_icon(const gchar *user_name, gint service); |
65
4949d4eb34ec
- revised store icon feature
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
64
diff
changeset
|
229 static void got_icon_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message); |
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:
148
diff
changeset
|
230 static void request_icon(const char *user_name, gint service, gboolean renew); |
86 | 231 static void mark_icon_for_user(GtkTextMark *mark, const gchar *user_name, gint service); |
94
31cddb2c2acc
fix icon position when the displaying message contains new line character. try 1.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
92
diff
changeset
|
232 static gboolean displaying_im_cb(PurpleAccount *account, const char *who, char **message, PurpleConversation *conv, PurpleMessageFlags flags, void *data); |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
233 static void displayed_im_cb(PurpleAccount *account, const char *who, char *message, PurpleConversation *conv, PurpleMessageFlags flags); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
234 static gboolean load_plugin(PurplePlugin *plugin); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
235 static gboolean unload_plugin(PurplePlugin *plugin); |
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
236 static void counter_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); |
148
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
237 |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
238 static void init_plugin(PurplePlugin *plugin); |
80
e0bf37c105eb
work in progress one hash table code:
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
78
diff
changeset
|
239 static void 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:
78
diff
changeset
|
240 static void cancel_fetch_func(gpointer key, gpointer value, gpointer 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
|
241 static gint get_service_type(PurpleConversation *conv); |
107
eb77d409c235
- do neither save nor cache icon image if pixbuf can not be obtained.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
105
diff
changeset
|
242 static GdkPixbuf *make_scaled_pixbuf(const gchar *url_text, gsize len); |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
243 |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
244 static void parse_user(xmlNode *user, status_t *st); |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
245 static void parse_status(xmlNode *status, status_t *st); |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
246 static void get_status_with_api_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, size_t len, const gchar *error_message); |
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
247 static gboolean get_status_with_api(gpointer data); |
125
f0305c387d32
replaced troublesome strptime() with our own function read_timestamp().
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
124
diff
changeset
|
248 static void read_timestamp(const char *str, struct tm *res); |
119
0c4a83f734cd
- duplication avoidance for the posted messages has been implemented.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
114
diff
changeset
|
249 |
148
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
250 static void strip_markup(gchar **str, gboolean escape); |
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
251 static gchar *strip_html_markup(const gchar *src); |
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
252 static GtkWidget *prefs_get_frame(PurplePlugin *plugin); |
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
253 |
164 | 254 /* more prototypes */ |
178
7fb35f47a477
keep posted statuses in the postedlist until they certainly become useless.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
168
diff
changeset
|
255 static gboolean is_posted_message(status_t *status, guint lastid); |
179
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
256 static void free_status(status_t *st); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
257 static gboolean ensure_path_exists(const char *dir); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
258 static gchar *twitter_memrchr(const gchar *s, int c, size_t n); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
259 static void got_page_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
260 static void cleanup_hash_entry_func(gpointer key, gpointer value, gpointer user_data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
261 static void invalidate_icon_data_func(gpointer key, gpointer value, gpointer user_data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
262 static void icon_size_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
263 static void interval_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
264 static void text_changed_cb(gpointer *data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
265 static void bool_toggled_cb(gpointer *data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
266 static void spin_changed_cb(gpointer *data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
267 static void combo_changed_cb(gpointer *data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
268 static void disconnect_prefs_cb(GtkObject *object, gpointer data); |
7a3ed2b113c5
added missing prototypes.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
178
diff
changeset
|
269 static GtkWidget *prefs_get_frame(PurplePlugin *plugin); |
211
e13103257b33
implemented filtering functionality.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
209
diff
changeset
|
270 static void apply_filter(gchar **sender, gchar **buffer, PurpleMessageFlags *flags, int 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:
215
diff
changeset
|
271 static gint get_service_type_by_account(PurpleAccount *account, const char *sender); |
148
4e9d0fd93fb6
- in saving icon file for twitter, proper extension is used.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
144
diff
changeset
|
272 |
64
da37857f3033
- separated header things into pidgin-twitter.h
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff
changeset
|
273 #endif |