libpurple/purpleconversation.c

changeset 43135
d00a312b1d42
parent 43130
ad73c9be8cb1
child 43137
8d1d2ab65c87
equal deleted inserted replaced
43134:dd4dc828a49d 43135:d00a312b1d42
41 char *id; 41 char *id;
42 PurpleConversationType type; 42 PurpleConversationType type;
43 PurpleAccount *account; 43 PurpleAccount *account;
44 44
45 PurpleAvatar *avatar; 45 PurpleAvatar *avatar;
46 char *name;
47 char *alias; 46 char *alias;
48 char *title; 47 char *title;
49 gboolean title_generated; 48 gboolean title_generated;
50 49
51 gboolean age_restricted; 50 gboolean age_restricted;
81 PROP_ID, 80 PROP_ID,
82 PROP_GLOBAL_ID, 81 PROP_GLOBAL_ID,
83 PROP_TYPE, 82 PROP_TYPE,
84 PROP_ACCOUNT, 83 PROP_ACCOUNT,
85 PROP_AVATAR, 84 PROP_AVATAR,
86 PROP_NAME,
87 PROP_ALIAS, 85 PROP_ALIAS,
88 PROP_TITLE, 86 PROP_TITLE,
89 PROP_TITLE_FOR_DISPLAY, 87 PROP_TITLE_FOR_DISPLAY,
90 PROP_TITLE_GENERATED, 88 PROP_TITLE_GENERATED,
91 PROP_AGE_RESTRICTED, 89 PROP_AGE_RESTRICTED,
510 break; 508 break;
511 case PROP_AVATAR: 509 case PROP_AVATAR:
512 purple_conversation_set_avatar(conversation, 510 purple_conversation_set_avatar(conversation,
513 g_value_get_object(value)); 511 g_value_get_object(value));
514 break; 512 break;
515 case PROP_NAME:
516 purple_conversation_set_name(conversation, g_value_get_string(value));
517 break;
518 case PROP_ALIAS: 513 case PROP_ALIAS:
519 purple_conversation_set_alias(conversation, g_value_get_string(value)); 514 purple_conversation_set_alias(conversation, g_value_get_string(value));
520 break; 515 break;
521 case PROP_TITLE: 516 case PROP_TITLE:
522 purple_conversation_set_title(conversation, g_value_get_string(value)); 517 purple_conversation_set_title(conversation, g_value_get_string(value));
612 purple_conversation_get_account(conversation)); 607 purple_conversation_get_account(conversation));
613 break; 608 break;
614 case PROP_AVATAR: 609 case PROP_AVATAR:
615 g_value_set_object(value, 610 g_value_set_object(value,
616 purple_conversation_get_avatar(conversation)); 611 purple_conversation_get_avatar(conversation));
617 break;
618 case PROP_NAME:
619 g_value_set_string(value, purple_conversation_get_name(conversation));
620 break; 612 break;
621 case PROP_ALIAS: 613 case PROP_ALIAS:
622 g_value_set_string(value, purple_conversation_get_alias(conversation)); 614 g_value_set_string(value, purple_conversation_get_alias(conversation));
623 break; 615 break;
624 case PROP_TITLE: 616 case PROP_TITLE:
760 purple_request_close_with_handle(conversation); 752 purple_request_close_with_handle(conversation);
761 753
762 g_clear_object(&conversation->account); 754 g_clear_object(&conversation->account);
763 g_clear_pointer(&conversation->id, g_free); 755 g_clear_pointer(&conversation->id, g_free);
764 g_clear_object(&conversation->avatar); 756 g_clear_object(&conversation->avatar);
765 g_clear_pointer(&conversation->name, g_free);
766 g_clear_pointer(&conversation->alias, g_free); 757 g_clear_pointer(&conversation->alias, g_free);
767 g_clear_pointer(&conversation->title, g_free); 758 g_clear_pointer(&conversation->title, g_free);
768 759
769 g_clear_pointer(&conversation->description, g_free); 760 g_clear_pointer(&conversation->description, g_free);
770 g_clear_pointer(&conversation->topic, g_free); 761 g_clear_pointer(&conversation->topic, g_free);
860 * Since: 3.0 851 * Since: 3.0
861 */ 852 */
862 properties[PROP_AVATAR] = g_param_spec_object( 853 properties[PROP_AVATAR] = g_param_spec_object(
863 "avatar", NULL, NULL, 854 "avatar", NULL, NULL,
864 PURPLE_TYPE_AVATAR, 855 PURPLE_TYPE_AVATAR,
865 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
866
867 /**
868 * PurpleConversation:name:
869 *
870 * The name of the conversation.
871 *
872 * Since: 3.0
873 */
874 properties[PROP_NAME] = g_param_spec_string(
875 "name", NULL, NULL,
876 NULL,
877 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); 856 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
878 857
879 /** 858 /**
880 * PurpleConversation:alias: 859 * PurpleConversation:alias:
881 * 860 *
1452 1431
1453 return conversation->title_generated; 1432 return conversation->title_generated;
1454 } 1433 }
1455 1434
1456 void 1435 void
1457 purple_conversation_set_name(PurpleConversation *conversation,
1458 const char *name)
1459 {
1460 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
1461
1462 if(g_set_str(&conversation->name, name)) {
1463 g_object_notify_by_pspec(G_OBJECT(conversation),
1464 properties[PROP_NAME]);
1465 }
1466 }
1467
1468 const char *
1469 purple_conversation_get_name(PurpleConversation *conversation) {
1470 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
1471
1472 return conversation->name;
1473 }
1474
1475 void
1476 purple_conversation_write_message(PurpleConversation *conversation, 1436 purple_conversation_write_message(PurpleConversation *conversation,
1477 PurpleMessage *message) 1437 PurpleMessage *message)
1478 { 1438 {
1479 PurpleConversationMember *member = NULL; 1439 PurpleConversationMember *member = NULL;
1480 1440

mercurial