| 376 } |
376 } |
| 377 |
377 |
| 378 static void |
378 static void |
| 379 gntmedia_message_cb(FinchMedia *gntmedia, const char *msg, PurpleConversation *conv) |
379 gntmedia_message_cb(FinchMedia *gntmedia, const char *msg, PurpleConversation *conv) |
| 380 { |
380 { |
| 381 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) { |
381 if (PURPLE_IS_IM_CONVERSATION(conv)) { |
| 382 purple_im_conversation_write_message(PURPLE_CONV_IM(conv), NULL, msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); |
382 purple_conversation_write_message(conv, NULL, msg, PURPLE_MESSAGE_SYSTEM, time(NULL)); |
| 383 } |
383 } |
| 384 } |
384 } |
| 385 |
385 |
| 386 static gboolean |
386 static gboolean |
| 387 finch_new_media(PurpleMediaManager *manager, PurpleMedia *media, |
387 finch_new_media(PurpleMediaManager *manager, PurpleMedia *media, |
| 388 PurpleAccount *account, gchar *name, gpointer null) |
388 PurpleAccount *account, gchar *name, gpointer null) |
| 389 { |
389 { |
| 390 GntWidget *gntmedia; |
390 GntWidget *gntmedia; |
| 391 PurpleConversation *conv; |
391 PurpleConversation *conv; |
| 392 |
392 |
| 393 conv = purple_im_conversation_new(account, name); |
393 conv = PURPLE_CONVERSATION(purple_im_conversation_new(account, name)); |
| 394 |
394 |
| 395 gntmedia = finch_media_new(media); |
395 gntmedia = finch_media_new(media); |
| 396 g_signal_connect(G_OBJECT(gntmedia), "message", G_CALLBACK(gntmedia_message_cb), conv); |
396 g_signal_connect(G_OBJECT(gntmedia), "message", G_CALLBACK(gntmedia_message_cb), conv); |
| 397 FINCH_MEDIA(gntmedia)->priv->conv = conv; |
397 FINCH_MEDIA(gntmedia)->priv->conv = conv; |
| 398 finch_conversation_set_info_widget(conv, gntmedia); |
398 finch_conversation_set_info_widget(conv, gntmedia); |