Mercurial > pidgin
comparison src/conversation.c @ 11146:1c5398ccbeb0
[gaim-migrate @ 13217]
Gaim-DBUS signal export works with DBUS >= 0.35
Various gaim API functions available through DBUS
committer: Tailor Script <tailor@pidgin.im>
author | Piotr Zielinski <zielaj> |
---|---|
date | Fri, 22 Jul 2005 19:47:29 +0000 |
parents | 096020ae09a9 |
children | ebb02ea3c789 |
comparison
equal
deleted
inserted
replaced
11145:dbc518c453f2 | 11146:1c5398ccbeb0 |
---|---|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 */ | 21 */ |
22 #include "internal.h" | 22 #include "internal.h" |
23 #include "blist.h" | 23 #include "blist.h" |
24 #include "conversation.h" | 24 #include "conversation.h" |
25 #include "dbus-maybe.h" | |
25 #include "debug.h" | 26 #include "debug.h" |
26 #include "imgstore.h" | 27 #include "imgstore.h" |
27 #include "notify.h" | 28 #include "notify.h" |
28 #include "prefs.h" | 29 #include "prefs.h" |
29 #include "prpl.h" | 30 #include "prpl.h" |
264 gaim_conv_window_new(void) | 265 gaim_conv_window_new(void) |
265 { | 266 { |
266 GaimConvWindow *win; | 267 GaimConvWindow *win; |
267 | 268 |
268 win = g_new0(GaimConvWindow, 1); | 269 win = g_new0(GaimConvWindow, 1); |
270 GAIM_DBUS_REGISTER_POINTER(win, GaimConvWindow); | |
269 | 271 |
270 windows = g_list_append(windows, win); | 272 windows = g_list_append(windows, win); |
271 | 273 |
272 win->ui_ops = gaim_conversations_get_win_ui_ops(); | 274 win->ui_ops = gaim_conversations_get_win_ui_ops(); |
273 | 275 |
316 | 318 |
317 g_list_free(gaim_conv_window_get_conversations(win)); | 319 g_list_free(gaim_conv_window_get_conversations(win)); |
318 | 320 |
319 windows = g_list_remove(windows, win); | 321 windows = g_list_remove(windows, win); |
320 | 322 |
323 GAIM_DBUS_UNREGISTER_POINTER(win); | |
321 g_free(win); | 324 g_free(win); |
322 } | 325 } |
323 } | 326 } |
324 | 327 |
325 void | 328 void |
670 | 673 |
671 gc = gaim_account_get_connection(account); | 674 gc = gaim_account_get_connection(account); |
672 g_return_val_if_fail(gc != NULL, NULL); | 675 g_return_val_if_fail(gc != NULL, NULL); |
673 | 676 |
674 conv = g_new0(GaimConversation, 1); | 677 conv = g_new0(GaimConversation, 1); |
678 GAIM_DBUS_REGISTER_POINTER(conv, GaimConversation); | |
675 | 679 |
676 conv->type = type; | 680 conv->type = type; |
677 conv->account = account; | 681 conv->account = account; |
678 conv->name = g_strdup(name); | 682 conv->name = g_strdup(name); |
679 conv->title = g_strdup(name); | 683 conv->title = g_strdup(name); |
690 if (type == GAIM_CONV_IM) | 694 if (type == GAIM_CONV_IM) |
691 { | 695 { |
692 GaimBuddyIcon *icon; | 696 GaimBuddyIcon *icon; |
693 conv->u.im = g_new0(GaimConvIm, 1); | 697 conv->u.im = g_new0(GaimConvIm, 1); |
694 conv->u.im->conv = conv; | 698 conv->u.im->conv = conv; |
699 GAIM_DBUS_REGISTER_POINTER(conv->u.im, GaimConvIm); | |
695 | 700 |
696 ims = g_list_append(ims, conv); | 701 ims = g_list_append(ims, conv); |
697 if ((icon = gaim_buddy_icons_find(account, name))) | 702 if ((icon = gaim_buddy_icons_find(account, name))) |
698 gaim_conv_im_set_icon(conv->u.im, icon); | 703 gaim_conv_im_set_icon(conv->u.im, icon); |
699 | 704 |
704 { | 709 { |
705 const char *disp; | 710 const char *disp; |
706 | 711 |
707 conv->u.chat = g_new0(GaimConvChat, 1); | 712 conv->u.chat = g_new0(GaimConvChat, 1); |
708 conv->u.chat->conv = conv; | 713 conv->u.chat->conv = conv; |
714 GAIM_DBUS_REGISTER_POINTER(conv->u.chat, GaimConvChat); | |
709 | 715 |
710 chats = g_list_append(chats, conv); | 716 chats = g_list_append(chats, conv); |
711 | 717 |
712 if ((disp = gaim_connection_get_display_name(account->gc))) | 718 if ((disp = gaim_connection_get_display_name(account->gc))) |
713 gaim_conv_chat_set_nick(conv->u.chat, disp); | 719 gaim_conv_chat_set_nick(conv->u.chat, disp); |
903 conv->u.chat->topic = NULL; | 909 conv->u.chat->topic = NULL; |
904 | 910 |
905 if(conv->u.chat->nick) | 911 if(conv->u.chat->nick) |
906 g_free(conv->u.chat->nick); | 912 g_free(conv->u.chat->nick); |
907 | 913 |
914 GAIM_DBUS_UNREGISTER_POINTER(conv->u.chat); | |
908 g_free(conv->u.chat); | 915 g_free(conv->u.chat); |
909 conv->u.chat = NULL; | 916 conv->u.chat = NULL; |
910 | 917 |
911 chats = g_list_remove(chats, conv); | 918 chats = g_list_remove(chats, conv); |
912 } | 919 } |
920 | 927 |
921 if (ops != NULL && ops->destroy_conversation != NULL) | 928 if (ops != NULL && ops->destroy_conversation != NULL) |
922 ops->destroy_conversation(conv); | 929 ops->destroy_conversation(conv); |
923 | 930 |
924 gaim_log_free(conv->log); | 931 gaim_log_free(conv->log); |
932 GAIM_DBUS_UNREGISTER_POINTER(conv); | |
925 g_free(conv); | 933 g_free(conv); |
926 conv = NULL; | 934 conv = NULL; |
927 } | 935 } |
928 | 936 |
929 | 937 |
2336 | 2344 |
2337 cb = g_new0(GaimConvChatBuddy, 1); | 2345 cb = g_new0(GaimConvChatBuddy, 1); |
2338 cb->name = g_strdup(name); | 2346 cb->name = g_strdup(name); |
2339 cb->flags = flags; | 2347 cb->flags = flags; |
2340 | 2348 |
2349 GAIM_DBUS_REGISTER_POINTER(cb, GaimConvChatBuddy); | |
2341 return cb; | 2350 return cb; |
2342 } | 2351 } |
2343 | 2352 |
2344 GaimConvChatBuddy * | 2353 GaimConvChatBuddy * |
2345 gaim_conv_chat_cb_find(GaimConvChat *chat, const char *name) | 2354 gaim_conv_chat_cb_find(GaimConvChat *chat, const char *name) |
2366 | 2375 |
2367 if (cb->name) | 2376 if (cb->name) |
2368 g_free(cb->name); | 2377 g_free(cb->name); |
2369 cb->name = NULL; | 2378 cb->name = NULL; |
2370 cb->flags = 0; | 2379 cb->flags = 0; |
2380 | |
2381 GAIM_DBUS_UNREGISTER_POINTER(cb); | |
2371 g_free(cb); | 2382 g_free(cb); |
2372 } | 2383 } |
2373 | 2384 |
2374 const char * | 2385 const char * |
2375 gaim_conv_chat_cb_get_name(GaimConvChatBuddy *cb) | 2386 gaim_conv_chat_cb_get_name(GaimConvChatBuddy *cb) |