Mercurial > pidgin.yaz
comparison plugins/musicmessaging/musicmessaging.c @ 11254:ce3b9969b399
[gaim-migrate @ 13426]
Fixed to not compile without dbus.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Muise <christian.muise@gmail.com> |
---|---|
date | Sat, 13 Aug 2005 15:53:29 +0000 |
parents | 1b32ad61e114 |
children | 6903f2f6d61f |
comparison
equal
deleted
inserted
replaced
11253:7d31d61e6438 | 11254:ce3b9969b399 |
---|---|
196 static void intercept_sent(GaimAccount *account, GaimConversation *conv, char **message, void* pData) | 196 static void intercept_sent(GaimAccount *account, GaimConversation *conv, char **message, void* pData) |
197 { | 197 { |
198 GaimConvIm *imData = gaim_conversation_get_im_data(conv); | 198 GaimConvIm *imData = gaim_conversation_get_im_data(conv); |
199 GaimConnection *connection = gaim_conversation_get_gc(conv); | 199 GaimConnection *connection = gaim_conversation_get_gc(conv); |
200 const char *convName = gaim_conversation_get_name(conv); | 200 const char *convName = gaim_conversation_get_name(conv); |
201 const char *who = gaim_account_get_username(account); | 201 /* const char *who = gaim_account_get_username(account); */ |
202 | 202 |
203 if (0 == strncmp(*message, MUSICMESSAGING_PREFIX, strlen(MUSICMESSAGING_PREFIX))) | 203 if (0 == strncmp(*message, MUSICMESSAGING_PREFIX, strlen(MUSICMESSAGING_PREFIX))) |
204 { | 204 { |
205 message = 0; | 205 message = 0; |
206 gaim_debug(GAIM_DEBUG_MISC, "gaim-musicmessaging", "Received MM Message\n"); | 206 gaim_debug(GAIM_DEBUG_MISC, "gaim-musicmessaging", "Received MM Message\n"); |
207 send_change_confirmed("the command", "the params"); | |
208 } | 207 } |
209 else if (0 == strncmp(*message, MUSICMESSAGING_START_TAG, strlen(MUSICMESSAGING_START_TAG))) | 208 else if (0 == strncmp(*message, MUSICMESSAGING_START_TAG, strlen(MUSICMESSAGING_START_TAG))) |
210 { | 209 { |
211 | 210 |
212 } | 211 } |
213 else | 212 else |
214 { | 213 { |
215 serv_send_im(connection, convName, *message, GAIM_MESSAGE_SEND); | 214 serv_send_im(connection, convName, *message, GAIM_MESSAGE_SEND); |
216 gaim_conv_im_write (imData, NULL, *message, GAIM_MESSAGE_SYSTEM, time(NULL)); | 215 gaim_conv_im_write (imData, NULL, *message, GAIM_MESSAGE_SEND, time(NULL)); |
217 } | 216 } |
218 } | 217 } |
219 | 218 |
220 static void intercept_received(GaimAccount *account, char **sender, char **message, GaimConversation *conv, int *flags) | 219 static void intercept_received(GaimAccount *account, char **sender, char **message, GaimConversation *conv, int *flags) |
221 { | 220 { |
224 | 223 |
225 | 224 |
226 static gboolean | 225 static gboolean |
227 start_session(MMConversation *mmconv) | 226 start_session(MMConversation *mmconv) |
228 { | 227 { |
229 mmconv->started = TRUE; | 228 if (!mmconv->requested) |
229 { | |
230 mmconv->originator = TRUE; | |
231 } | |
232 | |
230 run_editor(mmconv); | 233 run_editor(mmconv); |
231 return TRUE; | 234 return TRUE; |
232 } | 235 } |
233 | 236 |
234 static void music_button_toggled (GtkWidget *widget, gpointer data) | 237 static void music_button_toggled (GtkWidget *widget, gpointer data) |
235 { | 238 { |
236 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) | 239 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) |
237 { | 240 { |
238 start_session((MMConversation *) data); | 241 start_session((MMConversation *) data); |
239 } else { | 242 } else { |
240 kill_editor((MMConversation *) data); | 243 ((MMConversation *)data)->started = FALSE; |
244 kill_editor((MMConversation *) data); | |
241 } | 245 } |
242 } | 246 } |
243 | 247 |
244 static void set_editor_path (GtkWidget *button, GtkWidget *text_field) | 248 static void set_editor_path (GtkWidget *button, GtkWidget *text_field) |
245 { | 249 { |
256 args[1] = NULL; | 260 args[1] = NULL; |
257 if (!(g_spawn_async (".", args, NULL, 12, NULL, NULL, &(mmconv->pid), &spawn_error))) | 261 if (!(g_spawn_async (".", args, NULL, 12, NULL, NULL, &(mmconv->pid), &spawn_error))) |
258 { | 262 { |
259 gaim_notify_error(plugin_pointer, "Error Running Editor", | 263 gaim_notify_error(plugin_pointer, "Error Running Editor", |
260 "The following error has occured:", spawn_error->message); | 264 "The following error has occured:", spawn_error->message); |
265 mmconv->started = FALSE; | |
266 } | |
267 else | |
268 { | |
269 mmconv->started = TRUE; | |
261 } | 270 } |
262 } | 271 } |
263 | 272 |
264 static void kill_editor (MMConversation *mmconv) | 273 static void kill_editor (MMConversation *mmconv) |
265 { | 274 { |
318 button = gtk_toggle_button_new(); | 327 button = gtk_toggle_button_new(); |
319 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); | 328 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
320 | 329 |
321 g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(music_button_toggled), mmconv); | 330 g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(music_button_toggled), mmconv); |
322 | 331 |
323 gchar *file_path = g_build_filename (DATADIR, "pixmaps", "gaim", "buttons", "music.png", NULL); | 332 /* gchar *file_path = g_build_filename (DATADIR, "pixmaps", "gaim", "buttons", "music.png", NULL); */ |
324 image = gtk_image_new_from_file("/usr/local/share/pixmaps/gaim/buttons/music.png"); | 333 gchar *file_path = "/usr/local/share/pixmaps/gaim/buttons/music.png"; |
334 image = gtk_image_new_from_file(file_path); | |
325 | 335 |
326 gtk_container_add((GtkContainer *)button, image); | 336 gtk_container_add((GtkContainer *)button, image); |
327 | 337 |
328 sep = gtk_vseparator_new(); | 338 sep = gtk_vseparator_new(); |
329 | 339 |