Mercurial > pidgin-audacious
annotate pidgin-audacious.c @ 10:7c9624c8a109
added /song command which sends name of currently playing song.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 17 Sep 2008 11:06:15 +0900 |
parents | d5702f04b19c |
children | 43cb653de212 |
rev | line source |
---|---|
0 | 1 /* |
2 * Pidgin-Audacious plugin. | |
3 * | |
4 * This program is free software; you can redistribute it and/or | |
5 * modify it under the terms of the GNU General Public License as | |
6 * published by the Free Software Foundation; either version 2 of the | |
7 * License, or (at your option) any later version. | |
8 * | |
9 * This program is distributed in the hope that it will be useful, but | |
10 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 * General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
15 * along with this program; if not, write to the Free Software | |
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
17 * 02111-1307, USA. | |
18 */ | |
19 #define PURPLE_PLUGINS 1 | |
20 | |
21 #include <stdio.h> | |
22 #include <stdlib.h> | |
23 #include <string.h> | |
24 #include <glib.h> | |
25 | |
26 #include "gtkplugin.h" | |
27 #include "util.h" | |
28 #include "debug.h" | |
29 #include "connection.h" | |
30 #include "version.h" | |
10
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
31 #include "cmds.h" |
0 | 32 #include <audacious/audctrl.h> |
33 #include <audacious/dbus.h> | |
34 | |
7
feb13e877029
follow the change of botch_utf()
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
3
diff
changeset
|
35 extern gchar *botch_utf(const gchar *msg, gsize len, gsize *newlen) __attribute__ ((weak)); |
0 | 36 |
37 #define PIDGINAUD_PLUGIN_ID "pidgin_audacious" | |
38 | |
39 #define OPT_PIDGINAUD "/plugins/pidgin_audacious" | |
40 #define OPT_PROCESS_STATUS OPT_PIDGINAUD "/process_status" | |
41 #define OPT_PROCESS_USERINFO OPT_PIDGINAUD "/process_userinfo" | |
42 #define OPT_PROCESS_ALIAS OPT_PIDGINAUD "/process_alias" | |
43 | |
44 #define SONG_TOKEN "%song" | |
45 #define NO_SONG_MESSAGE "No song being played." | |
46 | |
47 #define BUDDY_ALIAS_MAXLEN 387 | |
48 | |
49 #define aud_debug(fmt, ...) purple_debug(PURPLE_DEBUG_INFO, "Pidgin-Audacious", \ | |
50 fmt, ## __VA_ARGS__); | |
51 #define aud_error(fmt, ...) purple_debug(PURPLE_DEBUG_ERROR, "Pidgin-Audacious", \ | |
52 fmt, ## __VA_ARGS__); | |
53 | |
54 static gint timeout_tag = 0; | |
55 | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
56 GHashTable *seed_status; |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
57 GHashTable *seed_userinfo; |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
58 GHashTable *seed_alias; |
0 | 59 |
60 GHashTable *pushed_status; | |
61 GHashTable *pushed_userinfo; | |
62 GHashTable *pushed_alias; | |
63 | |
64 DBusGProxy *session = NULL; | |
65 | |
10
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
66 static PurpleCmdId cmdid_paste_current_song; |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
67 |
0 | 68 static void aud_process(gchar *aud_info); |
69 | |
70 static DBusGProxy *get_dbus_proxy(void) | |
71 { | |
72 DBusGConnection *connection = NULL; | |
73 DBusGProxy *session = NULL; | |
74 GError *error = NULL; | |
75 connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); | |
76 g_clear_error(&error); | |
77 | |
78 session = dbus_g_proxy_new_for_name(connection, AUDACIOUS_DBUS_SERVICE, | |
79 AUDACIOUS_DBUS_PATH, | |
80 AUDACIOUS_DBUS_INTERFACE); | |
81 | |
82 g_clear_error(&error); | |
83 return session; | |
84 } | |
85 | |
86 static gboolean | |
87 watchdog_func(void) | |
88 { | |
89 gint playpos = 0; | |
90 gchar *song = NULL, *tmp = NULL; | |
91 | |
92 gboolean rv = TRUE; | |
93 size_t dummy; | |
94 | |
95 aud_debug("session = %p\n", session); | |
96 | |
97 aud_debug("is_playing = %d\n", audacious_remote_is_playing(session)); | |
98 | |
99 if(!audacious_remote_is_playing(session)) { /* audacious isn't playing */ | |
100 aud_process(NULL); | |
101 return rv; | |
102 } | |
103 | |
104 playpos = audacious_remote_get_playlist_pos(session); | |
105 tmp = audacious_remote_get_playlist_title(session, playpos); | |
106 if(tmp) { | |
107 if(botch_utf) // function exists | |
108 song = (gchar *) botch_utf(tmp, strlen(tmp), &dummy); | |
109 else | |
110 song = g_strdup(tmp); | |
111 } | |
112 g_free(tmp); | |
113 tmp = NULL; | |
114 | |
115 aud_process(song); | |
116 g_free(song); | |
117 song = NULL; | |
118 return rv; | |
119 } | |
120 | |
121 static void | |
122 aud_process_status(PurpleConnection *gc, gchar *aud_info) | |
123 { | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
124 gchar *new = NULL, *key = NULL; |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
125 const gchar *current, *seed, *pushed, *proto; |
0 | 126 PurpleAccount *account; |
127 PurplePresence *presence; | |
128 PurplePlugin *prpl; | |
129 PurplePluginProtocolInfo *prpl_info; | |
130 PurpleStatus *status; | |
131 | |
132 account = purple_connection_get_account(gc); | |
133 presence = purple_account_get_presence(account); | |
134 | |
135 proto = purple_account_get_protocol_id(account); | |
136 prpl = purple_find_prpl(proto); | |
137 g_return_if_fail(prpl != NULL); | |
138 | |
139 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); | |
140 g_return_if_fail(prpl_info != NULL && prpl_info->set_status != NULL); | |
141 | |
142 status = purple_presence_get_active_status(presence); | |
143 g_return_if_fail(status != NULL); | |
144 | |
145 /* generate key for hash table */ | |
146 key = g_strdup_printf("%s %s", account->username, account->protocol_id); | |
147 | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
148 /* retrieve current user status */ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
149 current = purple_status_get_attr_string(status, "message"); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
150 aud_debug("status current = %s\n", current); |
0 | 151 |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
152 /* invalidate pushded status on auto away etc. */ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
153 if(current == NULL || strlen(current) == 0) { |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
154 g_hash_table_replace(pushed_status, g_strdup(key), g_strdup("")); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
155 g_free(key); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
156 return; |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
157 } |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
158 |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
159 /* pop pushed_status */ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
160 pushed = (gchar *)g_hash_table_lookup(pushed_status, key); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
161 |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
162 /* if current status differs from pushed_status or contains token, replace hashes with current. */ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
163 if( (pushed && g_ascii_strcasecmp(current, pushed)) || strstr(current, SONG_TOKEN) ) { |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
164 g_hash_table_replace(seed_status, g_strdup(key), g_strdup(current)); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
165 g_hash_table_replace(pushed_status, g_strdup(key), g_strdup(current)); |
0 | 166 } |
167 | |
168 /* construct new status message */ | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
169 seed = (gchar *)g_hash_table_lookup(seed_status, key); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
170 g_return_if_fail(seed != NULL); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
171 aud_debug("status seed = %s\n", seed); |
0 | 172 |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
173 if(strstr(seed, SONG_TOKEN)) { |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
174 if(aud_info){ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
175 new = purple_strreplace(seed, SONG_TOKEN, aud_info); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
176 } |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
177 else { |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
178 new = g_strdup(NO_SONG_MESSAGE); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
179 } |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
180 } |
0 | 181 g_return_if_fail(new != NULL); |
182 | |
183 /* set status message only if text has been changed */ | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
184 pushed = (gchar *)g_hash_table_lookup(pushed_status, key); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
185 aud_debug("status pushed = %s\n", pushed); |
0 | 186 |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
187 if (!pushed || g_ascii_strcasecmp(pushed, new)) { |
0 | 188 g_hash_table_replace(pushed_status, g_strdup(key), g_strdup(new)); |
189 purple_status_set_attr_string(status, "message", new); | |
190 prpl_info->set_status(account, status); | |
191 } | |
192 g_free(key); | |
193 g_free(new); | |
194 } | |
195 | |
196 | |
197 static void | |
198 aud_process_userinfo(PurpleConnection *gc, gchar *aud_info) | |
199 { | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
200 gchar *new = NULL, *key = NULL; |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
201 const gchar *current, *seed, *pushed, *proto; |
0 | 202 PurpleAccount *account; |
203 PurplePlugin *prpl; | |
204 PurplePluginProtocolInfo *prpl_info; | |
205 | |
206 account = purple_connection_get_account(gc); | |
207 | |
208 proto = purple_account_get_protocol_id(account); | |
209 prpl = purple_find_prpl(proto); | |
210 g_return_if_fail(prpl != NULL); | |
211 | |
212 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); | |
213 g_return_if_fail(prpl_info != NULL && prpl_info->set_info != NULL); | |
214 | |
215 /* generate key for hash table*/ | |
216 key = g_strdup_printf("%s %s", account->username, account->protocol_id); | |
217 | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
218 /* retrieve current user info */ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
219 current = purple_account_get_user_info(account); /* it's always from account.xml! */ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
220 aud_debug("userinfo current = %s\n", current); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
221 |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
222 /* invalidate pushded status on auto away etc. */ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
223 if(current == NULL || strlen(current) == 0) { |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
224 g_hash_table_replace(pushed_userinfo, g_strdup(key), g_strdup("")); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
225 g_free(key); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
226 return; |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
227 } |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
228 |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
229 /* pop pushed_userinfo */ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
230 pushed = g_hash_table_lookup(pushed_userinfo, key); |
0 | 231 |
232 /* if current alias differs from pushed_alias or contains token, replace seed with this. */ | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
233 if( (pushed && g_ascii_strcasecmp(current, pushed)) || strstr(current, SONG_TOKEN) ) { |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
234 g_hash_table_replace(seed_userinfo, g_strdup(key), g_strdup(current)); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
235 g_hash_table_replace(pushed_userinfo, g_strdup(key), g_strdup(current)); |
0 | 236 } |
237 | |
238 /* construct new status message */ | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
239 seed = (gchar *)g_hash_table_lookup(seed_userinfo, key); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
240 g_return_if_fail(seed != NULL); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
241 aud_debug("userinfo seed = %s\n", seed); |
0 | 242 |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
243 if(strstr(seed, SONG_TOKEN)) { |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
244 if(aud_info){ |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
245 new = purple_strreplace(seed, SONG_TOKEN, aud_info); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
246 } |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
247 else { |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
248 new = g_strdup(NO_SONG_MESSAGE); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
249 } |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
250 } |
0 | 251 g_return_if_fail(new != NULL); |
252 | |
253 /* set user info only if text has been changed */ | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
254 pushed = (gchar *)g_hash_table_lookup(pushed_userinfo, key); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
255 aud_debug("userinfo pushed = %s\n", pushed); |
0 | 256 |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
257 if (!pushed || g_ascii_strcasecmp(pushed, new) != 0) { |
0 | 258 g_hash_table_replace(pushed_userinfo, g_strdup(key), g_strdup(new)); |
259 prpl_info->set_info(gc, new); | |
260 } | |
261 g_free(key); | |
262 g_free(new); | |
263 } | |
264 | |
265 static void | |
266 aud_process_alias(PurpleConnection *gc, gchar *aud_info) | |
267 { | |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
268 gchar *new = NULL, *key = NULL; |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
269 const gchar *current, *seed, *pushed, *proto; |
0 | 270 PurpleAccount *account; |
271 PurplePlugin *prpl; | |
272 PurplePluginProtocolInfo *prpl_info; | |
273 | |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
274 glong bytes; |
0 | 275 |
276 account = purple_connection_get_account(gc); | |
277 | |
278 proto = purple_account_get_protocol_id(account); | |
279 prpl = purple_find_prpl(proto); | |
280 g_return_if_fail(prpl != NULL); | |
281 | |
282 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); | |
283 g_return_if_fail(prpl_info != NULL); | |
284 | |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
285 /* generate key for hash table*/ |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
286 key = g_strdup_printf("%s %s", account->username, account->protocol_id); |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
287 |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
288 /* retrieve current alias */ |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
289 current = purple_account_get_alias(account); |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
290 if(current == NULL || strlen(current) == 0) { |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
291 aud_error("couldn't get current alias\n"); |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
292 g_free(key); |
0 | 293 return; |
294 } | |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
295 aud_debug("current alias = %s\n", current); |
0 | 296 |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
297 /* pop pushed_alias */ |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
298 pushed = g_hash_table_lookup(pushed_alias, key); |
0 | 299 |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
300 /* if current alias differs from pushed_alias or contains token, replace seed with current. */ |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
301 if( (pushed && g_ascii_strcasecmp(current, pushed)) || strstr(current, SONG_TOKEN) ) { |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
302 g_hash_table_replace(seed_alias, g_strdup(key), g_strdup(current)); |
0 | 303 } |
304 | |
305 /* construct new status message */ | |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
306 seed = g_hash_table_lookup(seed_alias, key); |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
307 g_return_if_fail(seed != NULL); |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
308 aud_debug("alias: seed = %s\n", (gchar *)seed); |
0 | 309 |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
310 bytes = strlen(seed); |
0 | 311 bytes -= strlen(SONG_TOKEN); |
312 aud_debug("alias: bytes = %ld", bytes); | |
313 | |
314 if(aud_info){ | |
315 gchar *tmp = g_malloc0(BUDDY_ALIAS_MAXLEN); | |
316 glong utflen = g_utf8_strlen(aud_info, BUDDY_ALIAS_MAXLEN/3 - bytes - 1); | |
317 g_utf8_strncpy(tmp, aud_info, utflen); | |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
318 new = purple_strreplace(seed, SONG_TOKEN, tmp); |
0 | 319 g_free(tmp); |
320 } | |
321 else { | |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
322 new = purple_strreplace(seed, SONG_TOKEN, NO_SONG_MESSAGE); |
0 | 323 } |
324 g_return_if_fail(new != NULL); | |
325 | |
326 /* set user info only if text has been changed */ | |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
327 pushed = g_hash_table_lookup(pushed_alias, key); |
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
328 aud_debug("alias pushed = %s\n", (gchar *)pushed); |
0 | 329 |
2
f1dc959e4706
modify process_alias to follow recent changes.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
1
diff
changeset
|
330 if (!pushed || g_ascii_strcasecmp(pushed, new) != 0) { |
0 | 331 gboolean ok = FALSE; |
332 PurplePlugin *msn_plugin = NULL; | |
333 msn_plugin = purple_plugins_find_with_id("prpl-msn"); | |
334 aud_debug("msn_plugin = %p\n", msn_plugin); | |
335 | |
336 g_hash_table_replace(pushed_alias, g_strdup(key), g_strdup(new)); | |
337 purple_plugin_ipc_call(msn_plugin, "msn_set_friendly_name", &ok, gc, new); | |
338 aud_debug("ipc %d\n", ok); | |
339 } | |
340 g_free(key); | |
341 g_free(new); | |
342 } | |
343 | |
344 static void | |
345 aud_process(gchar *aud_info) | |
346 { | |
347 GList *l; | |
348 PurpleConnection *gc; | |
349 | |
350 for (l = purple_connections_get_all(); l != NULL; l = l->next) { | |
351 gc = (PurpleConnection *) l->data; | |
352 | |
353 /* make sure we're connected */ | |
354 if (purple_connection_get_state(gc) != PURPLE_CONNECTED) { | |
355 continue; | |
356 } | |
357 | |
358 if (purple_prefs_get_bool(OPT_PROCESS_USERINFO)) { | |
359 aud_process_userinfo(gc, aud_info); | |
360 } | |
361 | |
362 if (purple_prefs_get_bool(OPT_PROCESS_STATUS)) { | |
363 aud_process_status(gc, aud_info); | |
364 } | |
365 | |
366 if (purple_prefs_get_bool(OPT_PROCESS_ALIAS)) { | |
367 aud_process_alias(gc, aud_info); | |
368 } | |
369 | |
370 } | |
371 } | |
372 static void | |
373 removekey(gpointer data) | |
374 { | |
375 g_free(data); | |
376 } | |
377 | |
378 static void | |
379 removeval(gpointer data) | |
380 { | |
381 g_free(data); | |
382 } | |
383 | |
384 static gboolean | |
385 restore_alias(PurpleConnection *gc, gpointer data) | |
386 { | |
387 PurpleAccount *account; | |
388 gpointer val = NULL; | |
389 gchar *key = NULL; | |
390 | |
391 aud_debug("********** restore_alias called **********\n"); | |
392 account = purple_connection_get_account(gc); | |
393 | |
394 key = g_strdup_printf("%s %s", account->username, account->protocol_id); | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
395 val = g_hash_table_lookup(seed_alias, key); |
0 | 396 g_return_val_if_fail(val != NULL, FALSE); |
397 | |
9
d5702f04b19c
Fixed a bug that disabling this plugin while watch dog function has been hooked causes crash.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
8
diff
changeset
|
398 aud_debug("write back alias %s\n", (char *)val); |
0 | 399 purple_account_set_alias(account, val); //oct16 |
400 | |
401 g_free(key); | |
402 | |
403 return TRUE; | |
404 } | |
405 | |
10
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
406 static PurpleCmdRet |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
407 paste_current_song(PurpleConversation *conv, const gchar *cmd, gchar **args, gchar **error, void *data) |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
408 { |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
409 gint playpos = 0; |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
410 gchar *song = NULL, *tmp = NULL; |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
411 PurpleConversationType type = purple_conversation_get_type(conv); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
412 size_t dummy; |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
413 |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
414 if(!audacious_remote_is_playing(session)) { /* audacious isn't playing */ |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
415 return PURPLE_CMD_RET_OK; |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
416 } |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
417 |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
418 playpos = audacious_remote_get_playlist_pos(session); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
419 tmp = audacious_remote_get_playlist_title(session, playpos); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
420 |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
421 if(tmp) { |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
422 if(botch_utf) // function exists |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
423 song = (gchar *) botch_utf(tmp, strlen(tmp), &dummy); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
424 else |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
425 song = g_strdup(tmp); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
426 } |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
427 g_free(tmp); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
428 tmp = NULL; |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
429 |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
430 if(type == PURPLE_CONV_TYPE_CHAT) { |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
431 PurpleConvChat *chat = purple_conversation_get_chat_data(conv); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
432 if (chat && song) |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
433 purple_conv_chat_send(chat, song); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
434 } |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
435 else if(type == PURPLE_CONV_TYPE_IM) { |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
436 PurpleConvIm *im = purple_conversation_get_im_data(conv); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
437 if(im && song) |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
438 purple_conv_im_send(im, song); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
439 } |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
440 |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
441 g_free(song); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
442 return PURPLE_CMD_RET_OK; |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
443 } |
0 | 444 |
445 static gboolean | |
446 load_plugin(PurplePlugin *plugin) | |
447 { | |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
448 seed_status = g_hash_table_new_full(g_str_hash, g_str_equal, removekey, removeval); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
449 seed_alias = g_hash_table_new_full(g_str_hash, g_str_equal, removekey, removeval); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
450 seed_userinfo = g_hash_table_new_full(g_str_hash, g_str_equal, removekey, removeval); |
0 | 451 |
452 pushed_status = g_hash_table_new_full(g_str_hash, g_str_equal, removekey, removeval); | |
453 pushed_alias = g_hash_table_new_full(g_str_hash, g_str_equal, removekey, removeval); | |
454 pushed_userinfo = g_hash_table_new_full(g_str_hash, g_str_equal, removekey, removeval); | |
455 | |
456 timeout_tag = g_timeout_add(15*1000, (gpointer)watchdog_func, NULL); | |
457 | |
458 /* connect to signing-off signal */ | |
459 purple_signal_connect(purple_connections_get_handle(), "signing-off", plugin, | |
460 PURPLE_CALLBACK(restore_alias), NULL); | |
461 | |
10
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
462 cmdid_paste_current_song = |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
463 purple_cmd_register("song", "", PURPLE_CMD_P_DEFAULT, |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
464 PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT, |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
465 NULL, paste_current_song, |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
466 "song: Paste currently plaing song", NULL); |
0 | 467 |
468 return TRUE; | |
469 } | |
470 | |
471 static gboolean | |
472 unload_plugin(PurplePlugin *plugin) | |
473 { | |
474 aud_debug("pidgin-audacious unload called\n"); | |
475 | |
9
d5702f04b19c
Fixed a bug that disabling this plugin while watch dog function has been hooked causes crash.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
8
diff
changeset
|
476 g_source_remove(timeout_tag); |
d5702f04b19c
Fixed a bug that disabling this plugin while watch dog function has been hooked causes crash.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
8
diff
changeset
|
477 |
1
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
478 g_hash_table_destroy(seed_status); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
479 g_hash_table_destroy(seed_alias); |
46071692f191
implement new replace logic to status and userinfo.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
0
diff
changeset
|
480 g_hash_table_destroy(seed_userinfo); |
0 | 481 |
482 g_hash_table_destroy(pushed_status); | |
483 g_hash_table_destroy(pushed_alias); | |
484 g_hash_table_destroy(pushed_userinfo); | |
485 | |
10
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
486 purple_cmd_unregister(cmdid_paste_current_song); |
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
487 |
0 | 488 return TRUE; |
489 } | |
490 | |
491 static PurplePluginPrefFrame * | |
492 get_plugin_pref_frame(PurplePlugin *plugin) | |
493 { | |
494 PurplePluginPref *pref; | |
495 PurplePluginPrefFrame *frame = purple_plugin_pref_frame_new(); | |
496 | |
497 /* create gtk elements for the plugin preferences */ | |
498 pref = purple_plugin_pref_new_with_label("Pidgin-Audacious Configuration"); | |
499 purple_plugin_pref_frame_add(frame, pref); | |
9
d5702f04b19c
Fixed a bug that disabling this plugin while watch dog function has been hooked causes crash.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
8
diff
changeset
|
500 |
0 | 501 pref = purple_plugin_pref_new_with_name_and_label(OPT_PROCESS_STATUS, |
502 "Expand " SONG_TOKEN " to song info in the status message"); | |
503 purple_plugin_pref_frame_add(frame, pref); | |
9
d5702f04b19c
Fixed a bug that disabling this plugin while watch dog function has been hooked causes crash.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
8
diff
changeset
|
504 |
0 | 505 pref = purple_plugin_pref_new_with_name_and_label(OPT_PROCESS_USERINFO, |
506 "Expand " SONG_TOKEN " to song info in the user info"); | |
507 purple_plugin_pref_frame_add(frame, pref); | |
508 | |
509 pref = purple_plugin_pref_new_with_name_and_label(OPT_PROCESS_ALIAS, | |
510 "Expand " SONG_TOKEN " to song info in the alias"); | |
511 purple_plugin_pref_frame_add(frame, pref); | |
512 | |
513 return frame; | |
514 } | |
515 | |
516 static PurplePluginUiInfo pref_info = | |
517 { | |
518 get_plugin_pref_frame | |
519 }; | |
520 | |
521 static PurplePluginInfo info = | |
522 { | |
523 PURPLE_PLUGIN_MAGIC, | |
524 PURPLE_MAJOR_VERSION, | |
525 PURPLE_MINOR_VERSION, | |
526 PURPLE_PLUGIN_STANDARD, /**< type */ | |
527 NULL, /**< ui_req */ | |
528 0, /**< flags */ | |
529 NULL, /**< deps */ | |
530 PURPLE_PRIORITY_DEFAULT, /**< priority */ | |
531 PIDGINAUD_PLUGIN_ID, /**< id */ | |
532 "Pidgin-Audacious", /**< name */ | |
10
7c9624c8a109
added /song command which sends name of currently playing song.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
9
diff
changeset
|
533 "2.1.0d1", /**< version */ |
0 | 534 "Automatically updates your Pidgin status info with the currently " |
535 "playing music in Audacious.", /** summary */ | |
536 "Automatically updates your Pidgin status info with the currently " | |
537 "playing music in Audacious.", /** desc */ | |
538 "Yoshiki Yazawa (yaz@honeyplanet.jp)", /**< author */ | |
539 "http://www.honeyplanet.jp", /**< homepage */ | |
540 load_plugin, /**< load */ | |
541 unload_plugin, /**< unload */ | |
542 NULL, /**< destroy */ | |
543 NULL, /**< ui_info */ | |
544 NULL, /**< extra_info */ | |
545 &pref_info, /**< pref info */ | |
546 NULL | |
547 }; | |
548 | |
549 static void | |
550 init_plugin(PurplePlugin *plugin) | |
551 { | |
552 g_type_init(); | |
553 | |
554 /* add plugin preferences */ | |
555 purple_prefs_add_none(OPT_PIDGINAUD); | |
556 purple_prefs_add_bool(OPT_PROCESS_STATUS, TRUE); | |
557 purple_prefs_add_bool(OPT_PROCESS_USERINFO, TRUE); | |
558 purple_prefs_add_bool(OPT_PROCESS_ALIAS, TRUE); | |
559 | |
560 session = get_dbus_proxy(); | |
561 } | |
562 | |
563 PURPLE_INIT_PLUGIN(pidgin_audacious, init_plugin, info) |