libpurple/purpleconversation.c

Wed, 13 Nov 2024 14:26:11 -0600

author
Markus Fischer <ivanhoe@fiscari.de>
date
Wed, 13 Nov 2024 14:26:11 -0600
changeset 43064
ac5311a8f11e
parent 43056
49358391e695
child 43071
071588186662
permissions
-rw-r--r--

Add PurpleConversation:error property

Testing Done:
Ran the unit test in valgrind.

Reviewed at https://reviews.imfreedom.org/r/3654/

66
cf3be86d0b63 [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
2 * Purple - Internet Messaging Library
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
4 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
7 * source distribution.
66
cf3be86d0b63 [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
12 * any later version.
66
cf3be86d0b63 [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
17 * more details.
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
18 *
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
19 * You should have received a copy of the GNU General Public License along with
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
66
cf3be86d0b63 [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 */
40441
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
22
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
23 #include <glib/gi18n-lib.h>
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
24
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
25 #include "purpleconversation.h"
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
26
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5860
diff changeset
27 #include "debug.h"
40992
3a973a9c5a64 migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents: 40948
diff changeset
28 #include "purpleconversationmanager.h"
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
29 #include "purpleconversationmember.h"
41007
90d2dee9b3dc Fix the includes for the purpleenums rename
Gary Kramlich <grim@reaperworld.com>
parents: 40992
diff changeset
30 #include "purpleenums.h"
41090
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
31 #include "purplehistorymanager.h"
40564
2c5b4dc2e86a Pull the purple_markup_* api out of util.[ch] to purplemarkup.[ch]. No code was changed just moved it from one file to the other.
Gary Kramlich <grim@reaperworld.com>
parents: 40541
diff changeset
32 #include "purplemarkup.h"
42321
9c0a6010fbc5 Use PurpleProtocolConversation if it's available when sending a message.
Gary Kramlich <grim@reaperworld.com>
parents: 42318
diff changeset
33 #include "purpleprotocolconversation.h"
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
34 #include "purpletags.h"
42997
368deff13c21 Split purpleprivate.h up into individual files
Gary Kramlich <grim@reaperworld.com>
parents: 42981
diff changeset
35 #include "request.h"
42725
ceb13f1de2d2 Remove PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents: 42720
diff changeset
36 #include "util.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5860
diff changeset
37
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
38 struct _PurpleConversation {
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
39 GObject parent;
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
40
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
41 char *id;
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
42 PurpleConversationType type;
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
43 PurpleAccount *account;
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
44
42355
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
45 PurpleAvatar *avatar;
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
46 char *name;
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
47 char *alias;
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
48 char *title;
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
49 gboolean title_generated;
11581
5c7f44be5dfe [gaim-migrate @ 13851]
Tim Ringenbach <marv@pidgin.im>
parents: 11552
diff changeset
50
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
51 gboolean age_restricted;
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
52 char *description;
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
53 char *topic;
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
54 PurpleContactInfo *topic_author;
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
55 GDateTime *topic_updated;
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
56 char *user_nickname;
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
57 gboolean favorite;
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
58 GDateTime *created_on;
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
59 PurpleContactInfo *creator;
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
60 gboolean online;
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
61 gboolean federated;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
62 PurpleTags *tags;
42891
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
63
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
64 PurpleConversationMembers *members;
42299
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
65
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
66 GListStore *messages;
42848
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
67 gboolean needs_attention;
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
68
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
69 PurpleTypingState typing_state;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
70 guint typing_state_source;
42902
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
71 GDateTime *last_typing;
42908
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
72
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
73 gboolean logging;
42916
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
74 gboolean drafting;
43064
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
75
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
76 GError *error;
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
77 };
27967
01a64c630e35 More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents: 27954
diff changeset
78
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
79 enum {
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
80 PROP_0,
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
81 PROP_ID,
42800
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
82 PROP_GLOBAL_ID,
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
83 PROP_TYPE,
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
84 PROP_ACCOUNT,
42355
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
85 PROP_AVATAR,
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
86 PROP_NAME,
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
87 PROP_ALIAS,
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
88 PROP_TITLE,
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
89 PROP_TITLE_FOR_DISPLAY,
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
90 PROP_TITLE_GENERATED,
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
91 PROP_AGE_RESTRICTED,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
92 PROP_DESCRIPTION,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
93 PROP_TOPIC,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
94 PROP_TOPIC_AUTHOR,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
95 PROP_TOPIC_UPDATED,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
96 PROP_USER_NICKNAME,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
97 PROP_FAVORITE,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
98 PROP_CREATED_ON,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
99 PROP_CREATOR,
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
100 PROP_ONLINE,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
101 PROP_FEDERATED,
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
102 PROP_TAGS,
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
103 PROP_MEMBERS,
42299
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
104 PROP_MESSAGES,
42848
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
105 PROP_NEEDS_ATTENTION,
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
106 PROP_TYPING_STATE,
42908
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
107 PROP_LOGGING,
42916
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
108 PROP_DRAFTING,
43064
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
109 PROP_ERROR,
42584
687260353985 Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42557
diff changeset
110 N_PROPERTIES,
27967
01a64c630e35 More efficient purple_find_conversation_with_account. Closes #9703.
Aman Gupta <aman@tmm1.net>
parents: 27954
diff changeset
111 };
42584
687260353985 Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42557
diff changeset
112 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
66
cf3be86d0b63 [gaim-migrate @ 76]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
114 enum {
42736
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
115 SIG_PRESENT,
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
116 N_SIGNALS,
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
117 };
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
118 static guint signals[N_SIGNALS] = {0, };
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
119
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
120 G_DEFINE_FINAL_TYPE(PurpleConversation, purple_conversation, G_TYPE_OBJECT)
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
121
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
122 static void purple_conversation_account_connected_cb(GObject *obj,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
123 GParamSpec *pspec,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
124 gpointer data);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
125
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
126 /**************************************************************************
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
127 * Helpers
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
128 **************************************************************************/
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
129 static void
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
130 purple_conversation_set_title_generated(PurpleConversation *conversation,
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
131 gboolean title_generated)
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
132 {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
133 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
134
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
135 /* If conversation isn't a dm or group dm, and title_generated is being set
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
136 * to %TRUE exit immediately because generating the title is only allowed
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
137 * on DMs and GroupDMs.
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
138 */
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
139 if(conversation->type != PURPLE_CONVERSATION_TYPE_DM &&
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
140 conversation->type != PURPLE_CONVERSATION_TYPE_GROUP_DM &&
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
141 title_generated)
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
142 {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
143 return;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
144 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
145
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
146 if(conversation->title_generated != title_generated) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
147 GObject *obj = G_OBJECT(conversation);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
148
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
149 conversation->title_generated = title_generated;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
150
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
151 g_object_freeze_notify(obj);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
152
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
153 if(conversation->title_generated) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
154 purple_conversation_generate_title(conversation);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
155 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
156
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
157 g_object_notify_by_pspec(G_OBJECT(conversation),
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
158 properties[PROP_TITLE_GENERATED]);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
159
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
160 g_object_thaw_notify(obj);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
161 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
162 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
163
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
164 static void
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
165 purple_conversation_set_id(PurpleConversation *conversation, const char *id) {
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
166 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
167
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42760
diff changeset
168 if(g_set_str(&conversation->id, id)) {
42800
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
169 GObject *obj = G_OBJECT(conversation);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
170
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
171 g_object_freeze_notify(obj);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
172 g_object_notify_by_pspec(obj, properties[PROP_ID]);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
173 g_object_notify_by_pspec(obj, properties[PROP_GLOBAL_ID]);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
174 g_object_thaw_notify(obj);
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
175 }
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
176 }
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
177
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
178 static void
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
179 purple_conversation_set_account(PurpleConversation *conversation,
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
180 PurpleAccount *account)
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
181 {
42514
461893f76c54 Automatically add accounts as a member when creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42486
diff changeset
182 PurpleConversationMember *member = NULL;
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
183
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
184 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
185
42514
461893f76c54 Automatically add accounts as a member when creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42486
diff changeset
186 /* Remove the account from the conversation if it's a member. */
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
187 if(PURPLE_IS_ACCOUNT(conversation->account)) {
42514
461893f76c54 Automatically add accounts as a member when creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42486
diff changeset
188 if(PURPLE_IS_CONVERSATION_MEMBER(member)) {
42805
3e77e81168a5 Update libpurple to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents: 42800
diff changeset
189 PurpleContactInfo *info = NULL;
3e77e81168a5 Update libpurple to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents: 42800
diff changeset
190
3e77e81168a5 Update libpurple to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents: 42800
diff changeset
191 info = purple_account_get_contact_info(conversation->account);
42891
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
192 purple_conversation_members_remove_member(conversation->members,
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
193 info, FALSE, NULL);
42514
461893f76c54 Automatically add accounts as a member when creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42486
diff changeset
194 }
461893f76c54 Automatically add accounts as a member when creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42486
diff changeset
195 }
461893f76c54 Automatically add accounts as a member when creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42486
diff changeset
196
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
197 if(g_set_object(&conversation->account, account)) {
42800
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
198 GObject *obj = NULL;
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
199
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
200 if(PURPLE_IS_ACCOUNT(conversation->account)) {
42805
3e77e81168a5 Update libpurple to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents: 42800
diff changeset
201 PurpleContactInfo *info = NULL;
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
202 PurpleConversationMember *member = NULL;
42968
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
203 const char *tag_value = NULL;
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
204
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
205 tag_value = purple_account_get_id(conversation->account);
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
206 purple_tags_add_with_value(conversation->tags, "account-id",
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
207 tag_value);
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
208
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
209 tag_value = purple_account_get_protocol_id(conversation->account);
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
210 purple_tags_add_with_value(conversation->tags, "protocol-id",
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
211 tag_value);
42805
3e77e81168a5 Update libpurple to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents: 42800
diff changeset
212
3e77e81168a5 Update libpurple to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents: 42800
diff changeset
213 info = purple_account_get_contact_info(account);
42891
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
214 member = purple_conversation_members_add_member(conversation->members,
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
215 info, FALSE, NULL);
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
216
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
217 g_object_bind_property(conversation, "typing-state",
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
218 member, "typing-state",
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
219 G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
42514
461893f76c54 Automatically add accounts as a member when creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42486
diff changeset
220
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
221 g_signal_connect_object(account, "notify::connected",
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
222 G_CALLBACK(purple_conversation_account_connected_cb),
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
223 conversation, G_CONNECT_DEFAULT);
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
224 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
225
42800
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
226 obj = G_OBJECT(conversation);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
227 g_object_freeze_notify(obj);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
228 g_object_notify_by_pspec(obj, properties[PROP_ACCOUNT]);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
229 g_object_notify_by_pspec(obj, properties[PROP_GLOBAL_ID]);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
230 g_object_thaw_notify(obj);
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
231 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
232 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
233
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
234 static void
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
235 purple_conversation_set_conversation_type(PurpleConversation *conversation,
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
236 PurpleConversationType type)
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
237 {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
238 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
239
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
240 if(type != conversation->type) {
42968
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
241 const char *tag_value = NULL;
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
242
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
243 conversation->type = type;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
244
42968
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
245 switch(conversation->type) {
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
246 case PURPLE_CONVERSATION_TYPE_DM:
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
247 tag_value = "dm";
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
248 break;
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
249 case PURPLE_CONVERSATION_TYPE_GROUP_DM:
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
250 tag_value = "group-dm";
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
251 break;
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
252 case PURPLE_CONVERSATION_TYPE_CHANNEL:
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
253 tag_value = "channel";
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
254 break;
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
255 case PURPLE_CONVERSATION_TYPE_THREAD:
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
256 tag_value = "thread";
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
257 break;
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
258 case PURPLE_CONVERSATION_TYPE_UNSET:
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
259 default:
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
260 tag_value = NULL;
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
261 }
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
262
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
263 purple_tags_add_with_value(conversation->tags, "type", tag_value);
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
264
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
265 g_object_notify_by_pspec(G_OBJECT(conversation),
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
266 properties[PROP_TYPE]);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
267 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
268 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
269
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
270 static void
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
271 purple_conversation_set_federated(PurpleConversation *conversation,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
272 gboolean federated)
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
273 {
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
274 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
275
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
276 if(conversation->federated != federated) {
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
277 conversation->federated = federated;
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
278
42968
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
279 if(federated) {
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
280 purple_tags_add(conversation->tags, "federated");
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
281 }
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
282
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
283 g_object_notify_by_pspec(G_OBJECT(conversation),
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
284 properties[PROP_FEDERATED]);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
285 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
286 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
287
4359
cf899ee07d1d [gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents: 4349
diff changeset
288 static void
42743
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
289 purple_conversation_send_message_async_cb(GObject *source,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
290 GAsyncResult *result,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
291 gpointer data)
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
292 {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
293 PurpleMessage *message = NULL;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
294 PurpleProtocolConversation *protocol = NULL;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
295 GError *error = NULL;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
296 GTask *task = data;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
297 gboolean success = FALSE;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
298
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
299 /* task and result share a cancellable, so we just need to clear task to
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
300 * make sure its callback gets called.
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
301 */
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
302 if(g_task_return_error_if_cancelled(G_TASK(task))) {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
303 g_clear_object(&task);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
304
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
305 return;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
306 }
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
307
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
308 protocol = PURPLE_PROTOCOL_CONVERSATION(source);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
309 message = g_task_get_task_data(G_TASK(task));
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
310
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
311 success = purple_protocol_conversation_send_message_finish(protocol,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
312 result, &error);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
313
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
314 if(!success) {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
315 if(error == NULL) {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
316 error = g_error_new(PURPLE_CONVERSATION_DOMAIN, 0,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
317 "unknown error");
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
318 }
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
319
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
320 purple_message_set_error(message, error);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
321 g_task_return_error(task, error);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
322
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
323 g_clear_error(&error);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
324 } else {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
325 /* If the protocol didn't set delivered, set it now. */
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
326 if(!purple_message_get_delivered(message)) {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
327 purple_message_set_delivered(message, TRUE);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
328 }
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
329
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
330 g_task_return_boolean(task, TRUE);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
331 }
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
332
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
333 g_clear_object(&task);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
334 }
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
335
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
336 /**************************************************************************
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
337 * Callbacks
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
338 **************************************************************************/
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
339 static void
42891
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
340 purple_conversation_members_item_changed_cb(G_GNUC_UNUSED GListModel *model,
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
341 G_GNUC_UNUSED guint position,
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
342 G_GNUC_UNUSED guint removed,
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
343 G_GNUC_UNUSED guint added,
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
344 gpointer data)
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
345 {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
346 PurpleConversation *conversation = data;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
347
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
348 if(purple_conversation_get_title_generated(conversation)) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
349 purple_conversation_generate_title(conversation);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
350 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
351 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
352
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
353 static void
42981
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
354 purple_conversation_members_member_added_cb(G_GNUC_UNUSED PurpleConversationMembers *members,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
355 PurpleConversationMember *member,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
356 gboolean announce,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
357 const char *join_message,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
358 gpointer data)
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
359 {
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
360 PurpleConversation *conversation = data;
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
361 PurpleMessage *message = NULL;
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
362 char *contents = NULL;
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
363
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
364 if(!announce) {
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
365 return;
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
366 }
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
367
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
368 if(purple_strempty(join_message)) {
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
369 contents = g_strdup_printf(_("%s has joined the conversation"),
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
370 purple_conversation_member_get_name_for_display(member));
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
371 } else {
43018
78cd7c6e8c40 If a message as given when a user join/parts a conversation use it explicitly
Gary Kramlich <grim@reaperworld.com>
parents: 43017
diff changeset
372 contents = g_strdup(join_message);
42981
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
373 }
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
374
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
375 message = g_object_new(
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
376 PURPLE_TYPE_MESSAGE,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
377 "contents", contents,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
378 "event", TRUE,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
379 NULL);
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
380
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
381 g_free(contents);
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
382
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
383 purple_conversation_write_message(conversation, message);
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
384 }
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
385
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
386 static void
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
387 purple_conversation_members_member_removed_cb(G_GNUC_UNUSED PurpleConversationMembers *members,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
388 PurpleConversationMember *member,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
389 gboolean announce,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
390 const char *part_message,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
391 gpointer data)
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
392 {
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
393 PurpleConversation *conversation = data;
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
394 PurpleMessage *message = NULL;
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
395 char *contents = NULL;
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
396
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
397 if(!announce) {
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
398 return;
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
399 }
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
400
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
401 if(purple_strempty(part_message)) {
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
402 contents = g_strdup_printf(_("%s has left the conversation"),
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
403 purple_conversation_member_get_name_for_display(member));
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
404 } else {
43018
78cd7c6e8c40 If a message as given when a user join/parts a conversation use it explicitly
Gary Kramlich <grim@reaperworld.com>
parents: 43017
diff changeset
405 contents = g_strdup(part_message);
42981
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
406 }
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
407
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
408 message = g_object_new(
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
409 PURPLE_TYPE_MESSAGE,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
410 "contents", contents,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
411 "event", TRUE,
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
412 NULL);
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
413
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
414 g_free(contents);
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
415
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
416 purple_conversation_write_message(conversation, message);
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
417 }
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
418
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
419 static void
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
420 purple_conversation_account_connected_cb(GObject *obj,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
421 G_GNUC_UNUSED GParamSpec *pspec,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
422 gpointer data)
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
423 {
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
424 PurpleConversation *conversation = data;
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
425 gboolean connected = purple_account_is_connected(PURPLE_ACCOUNT(obj));
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
426
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
427 if(conversation->federated) {
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
428 /* If the account changed to connected and the conversation is
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
429 * federated we do nothing. But if the account went offline, we can
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
430 * safely set the conversation to offline.
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
431 */
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
432 if(!connected) {
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
433 purple_conversation_set_online(conversation, FALSE);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
434 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
435 } else {
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
436 purple_conversation_set_online(conversation, connected);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
437 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
438 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
439
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
440 /*
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
441 * purple_conversation_typing_state_typing_cb: (skip)
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
442 * @data: The conversation instance.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
443 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
444 * If this callback manages to get called, it means the user has stopped typing
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
445 * and we need to change the typing state of the conversation to paused.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
446 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
447 * There's some specific ordering we have to worry about because
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
448 * purple_conversation_set_typing_state will attempt to remove the source that
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
449 * called us even though we're going to exit cleanly after we call that
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
450 * function.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
451 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
452 * To avoid this, we just set the typing_state_source to 0 which will make
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
453 * purple_conversation_set_typing_state not try to cancel the source.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
454 */
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
455 static void
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
456 purple_conversation_typing_state_typing_cb(gpointer data) {
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
457 PurpleConversation *conversation = data;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
458
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
459 conversation->typing_state_source = 0;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
460
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
461 purple_conversation_set_typing_state(conversation,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
462 PURPLE_TYPING_STATE_PAUSED);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
463 }
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
464
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
465 /*
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
466 * purple_conversation_typing_state_paused_cb: (skip)
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
467 * @data: The conversation instance.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
468 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
469 * If this callback manages to get called, it means the user has stopped typing
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
470 * some time ago, and we need to set the state to NONE.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
471 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
472 * There's some specific ordering we have to worry about because
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
473 * purple_conversation_set_typing_state will attempt to remove the source that
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
474 * called us even though we're going to exit cleanly after we call that
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
475 * function.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
476 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
477 * To avoid this, we just set the typing_state_source to 0 which will make
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
478 * purple_conversation_set_typing_state not try to cancel the source.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
479 */
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
480 static void
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
481 purple_conversation_typing_state_paused_cb(gpointer data) {
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
482 PurpleConversation *conversation = data;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
483
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
484 conversation->typing_state_source = 0;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
485
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
486 purple_conversation_set_typing_state(conversation,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
487 PURPLE_TYPING_STATE_NONE);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
488 }
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
489
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
490 /**************************************************************************
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
491 * GObject Implementation
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
492 **************************************************************************/
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
493 static void
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
494 purple_conversation_set_property(GObject *obj, guint param_id,
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
495 const GValue *value, GParamSpec *pspec)
14582
ae974395b9da [gaim-migrate @ 17240]
Lars T. Mikkelsen
parents: 14254
diff changeset
496 {
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
497 PurpleConversation *conversation = PURPLE_CONVERSATION(obj);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
498
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
499 switch (param_id) {
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
500 case PROP_ID:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
501 purple_conversation_set_id(conversation, g_value_get_string(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
502 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
503 case PROP_TYPE:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
504 purple_conversation_set_conversation_type(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
505 g_value_get_enum(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
506 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
507 case PROP_ACCOUNT:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
508 purple_conversation_set_account(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
509 g_value_get_object(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
510 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
511 case PROP_AVATAR:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
512 purple_conversation_set_avatar(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
513 g_value_get_object(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
514 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
515 case PROP_NAME:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
516 purple_conversation_set_name(conversation, g_value_get_string(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
517 break;
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
518 case PROP_ALIAS:
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
519 purple_conversation_set_alias(conversation, g_value_get_string(value));
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
520 break;
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
521 case PROP_TITLE:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
522 purple_conversation_set_title(conversation, g_value_get_string(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
523 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
524 case PROP_AGE_RESTRICTED:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
525 purple_conversation_set_age_restricted(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
526 g_value_get_boolean(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
527 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
528 case PROP_DESCRIPTION:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
529 purple_conversation_set_description(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
530 g_value_get_string(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
531 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
532 case PROP_TOPIC:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
533 purple_conversation_set_topic(conversation, g_value_get_string(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
534 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
535 case PROP_TOPIC_AUTHOR:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
536 purple_conversation_set_topic_author(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
537 g_value_get_object(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
538 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
539 case PROP_TOPIC_UPDATED:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
540 purple_conversation_set_topic_updated(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
541 g_value_get_boxed(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
542 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
543 case PROP_USER_NICKNAME:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
544 purple_conversation_set_user_nickname(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
545 g_value_get_string(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
546 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
547 case PROP_FAVORITE:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
548 purple_conversation_set_favorite(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
549 g_value_get_boolean(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
550 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
551 case PROP_CREATED_ON:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
552 purple_conversation_set_created_on(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
553 g_value_get_boxed(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
554 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
555 case PROP_CREATOR:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
556 purple_conversation_set_creator(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
557 g_value_get_object(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
558 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
559 case PROP_ONLINE:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
560 purple_conversation_set_online(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
561 g_value_get_boolean(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
562 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
563 case PROP_FEDERATED:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
564 purple_conversation_set_federated(conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
565 g_value_get_boolean(value));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
566 break;
42848
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
567 case PROP_NEEDS_ATTENTION:
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
568 purple_conversation_set_needs_attention(conversation,
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
569 g_value_get_boolean(value));
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
570 break;
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
571 case PROP_TYPING_STATE:
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
572 purple_conversation_set_typing_state(conversation,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
573 g_value_get_enum(value));
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
574 break;
42908
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
575 case PROP_LOGGING:
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
576 purple_conversation_set_logging(conversation,
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
577 g_value_get_boolean(value));
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
578 break;
42916
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
579 case PROP_DRAFTING:
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
580 purple_conversation_set_drafting(conversation,
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
581 g_value_get_boolean(value));
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
582 break;
43064
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
583 case PROP_ERROR:
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
584 purple_conversation_set_error(conversation, g_value_get_boxed(value));
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
585 break;
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
586 default:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
587 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
588 break;
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
589 }
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
590 }
23312
0530decb56e4 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23278
diff changeset
591
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
592 static void
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
593 purple_conversation_get_property(GObject *obj, guint param_id, GValue *value,
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
594 GParamSpec *pspec)
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
595 {
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
596 PurpleConversation *conversation = PURPLE_CONVERSATION(obj);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
597
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
598 switch(param_id) {
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
599 case PROP_ID:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
600 g_value_set_string(value, purple_conversation_get_id(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
601 break;
42800
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
602 case PROP_GLOBAL_ID:
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
603 g_value_take_string(value,
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
604 purple_conversation_get_global_id(conversation));
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
605 break;
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
606 case PROP_TYPE:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
607 g_value_set_enum(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
608 purple_conversation_get_conversation_type(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
609 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
610 case PROP_ACCOUNT:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
611 g_value_set_object(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
612 purple_conversation_get_account(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
613 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
614 case PROP_AVATAR:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
615 g_value_set_object(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
616 purple_conversation_get_avatar(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
617 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
618 case PROP_NAME:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
619 g_value_set_string(value, purple_conversation_get_name(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
620 break;
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
621 case PROP_ALIAS:
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
622 g_value_set_string(value, purple_conversation_get_alias(conversation));
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
623 break;
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
624 case PROP_TITLE:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
625 g_value_set_string(value, purple_conversation_get_title(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
626 break;
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
627 case PROP_TITLE_FOR_DISPLAY:
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
628 g_value_set_string(value,
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
629 purple_conversation_get_title_for_display(conversation));
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
630 break;
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
631 case PROP_TITLE_GENERATED:
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
632 g_value_set_boolean(value,
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
633 purple_conversation_get_title_generated(conversation));
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
634 break;
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
635 case PROP_AGE_RESTRICTED:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
636 g_value_set_boolean(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
637 purple_conversation_get_age_restricted(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
638 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
639 case PROP_DESCRIPTION:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
640 g_value_set_string(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
641 purple_conversation_get_description(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
642 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
643 case PROP_TOPIC:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
644 g_value_set_string(value, purple_conversation_get_topic(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
645 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
646 case PROP_TOPIC_AUTHOR:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
647 g_value_set_object(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
648 purple_conversation_get_topic_author(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
649 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
650 case PROP_TOPIC_UPDATED:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
651 g_value_set_boxed(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
652 purple_conversation_get_topic_updated(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
653 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
654 case PROP_USER_NICKNAME:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
655 g_value_set_string(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
656 purple_conversation_get_user_nickname(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
657 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
658 case PROP_FAVORITE:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
659 g_value_set_boolean(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
660 purple_conversation_get_favorite(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
661 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
662 case PROP_CREATED_ON:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
663 g_value_set_boxed(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
664 purple_conversation_get_created_on(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
665 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
666 case PROP_CREATOR:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
667 g_value_set_object(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
668 purple_conversation_get_creator(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
669 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
670 case PROP_ONLINE:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
671 g_value_set_boolean(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
672 purple_conversation_get_online(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
673 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
674 case PROP_FEDERATED:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
675 g_value_set_boolean(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
676 purple_conversation_get_federated(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
677 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
678 case PROP_TAGS:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
679 g_value_set_object(value, purple_conversation_get_tags(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
680 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
681 case PROP_MEMBERS:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
682 g_value_set_object(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
683 purple_conversation_get_members(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
684 break;
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
685 case PROP_MESSAGES:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
686 g_value_set_object(value,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
687 purple_conversation_get_messages(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
688 break;
42848
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
689 case PROP_NEEDS_ATTENTION:
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
690 g_value_set_boolean(value,
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
691 purple_conversation_get_needs_attention(conversation));
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
692 break;
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
693 case PROP_TYPING_STATE:
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
694 g_value_set_enum(value,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
695 purple_conversation_get_typing_state(conversation));
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
696 break;
42908
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
697 case PROP_LOGGING:
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
698 g_value_set_boolean(value,
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
699 purple_conversation_get_logging(conversation));
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
700 break;
42916
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
701 case PROP_DRAFTING:
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
702 g_value_set_boolean(value,
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
703 purple_conversation_get_drafting(conversation));
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
704 break;
43064
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
705 case PROP_ERROR:
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
706 g_value_set_boxed(value, purple_conversation_get_error(conversation));
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
707 break;
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
708 default:
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
709 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
710 break;
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
711 }
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
712 }
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
713
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
714 static void
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
715 purple_conversation_init(PurpleConversation *conversation) {
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
716 conversation->tags = purple_tags_new();
42968
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
717
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
718 /* If type provided during construction, the type setter isn't called,
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
719 * which means this tag doesn't get created. To work around this, we set it
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
720 * here, which will be overridden by the type setter.
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
721 */
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
722 purple_tags_add(conversation->tags, "type");
9bb936b002a2 Add some automatic tags to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42939
diff changeset
723
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
724 conversation->messages = g_list_store_new(PURPLE_TYPE_MESSAGE);
42891
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
725
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
726 conversation->members = purple_conversation_members_new();
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
727 g_signal_connect_object(conversation->members, "items-changed",
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
728 G_CALLBACK(purple_conversation_members_item_changed_cb),
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
729 conversation, G_CONNECT_DEFAULT);
42981
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
730 g_signal_connect_object(conversation->members, "member-added",
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
731 G_CALLBACK(purple_conversation_members_member_added_cb),
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
732 conversation, G_CONNECT_DEFAULT);
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
733 g_signal_connect_object(conversation->members, "member-removed",
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
734 G_CALLBACK(purple_conversation_members_member_removed_cb),
c512d4a3eda0 Add some basic event messages for membership changes
Gary Kramlich <grim@reaperworld.com>
parents: 42968
diff changeset
735 conversation, G_CONNECT_DEFAULT);
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
736 }
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
737
34687
aebc4dd321bf Use GObject constructed for PurpleConversation, PurpleIMConversation and PurpleChatConversation
Ankit Vani <a@nevitus.org>
parents: 34684
diff changeset
738 static void
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
739 purple_conversation_constructed(GObject *object) {
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
740 PurpleConversation *conversation = PURPLE_CONVERSATION(object);
31906
d1ffe4b1de91 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <darkrain42@pidgin.im>
parents: 31905
diff changeset
741
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
742 G_OBJECT_CLASS(purple_conversation_parent_class)->constructed(object);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
743
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
744 if(purple_strempty(conversation->title)) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
745 if(conversation->type == PURPLE_CONVERSATION_TYPE_DM ||
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
746 conversation->type == PURPLE_CONVERSATION_TYPE_GROUP_DM)
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
747 {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
748 /* There's no way to add members during construction, so just call
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
749 * set_title_generated.
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
750 */
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
751 purple_conversation_set_title_generated(conversation, TRUE);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
752 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
753 }
5858
1bc64d957067 [gaim-migrate @ 6289]
Nathan Walp <nwalp@pidgin.im>
parents: 5776
diff changeset
754 }
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
755
36109
2e4dd08b0131 Conversations: fix glib warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
756 static void
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
757 purple_conversation_dispose(GObject *obj) {
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
758 g_object_set_data(obj, "is-finalizing", GINT_TO_POINTER(TRUE));
36109
2e4dd08b0131 Conversations: fix glib warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
759 }
2e4dd08b0131 Conversations: fix glib warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
760
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
761 static void
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
762 purple_conversation_finalize(GObject *object) {
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
763 PurpleConversation *conversation = PURPLE_CONVERSATION(object);
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 30706
diff changeset
764
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
765 purple_request_close_with_handle(conversation);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
766
42778
4aa4ab7b24a7 Add the ability to leave conversations to PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42773
diff changeset
767 g_clear_object(&conversation->account);
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
768 g_clear_pointer(&conversation->id, g_free);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
769 g_clear_object(&conversation->avatar);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
770 g_clear_pointer(&conversation->name, g_free);
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
771 g_clear_pointer(&conversation->alias, g_free);
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
772 g_clear_pointer(&conversation->title, g_free);
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
773
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
774 g_clear_pointer(&conversation->description, g_free);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
775 g_clear_pointer(&conversation->topic, g_free);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
776 g_clear_object(&conversation->topic_author);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
777 g_clear_pointer(&conversation->topic_updated, g_date_time_unref);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
778 g_clear_pointer(&conversation->user_nickname, g_free);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
779 g_clear_pointer(&conversation->created_on, g_date_time_unref);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
780 g_clear_object(&conversation->creator);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
781 g_clear_object(&conversation->tags);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
782 g_clear_object(&conversation->members);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
783 g_clear_object(&conversation->messages);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
784
42902
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
785 g_clear_handle_id(&conversation->typing_state_source, g_source_remove);
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
786 g_clear_pointer(&conversation->last_typing, g_date_time_unref);
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
787
43064
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
788 g_clear_error(&conversation->error);
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
789
39380
3088866c22f4 libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents: 39352
diff changeset
790 G_OBJECT_CLASS(purple_conversation_parent_class)->finalize(object);
6485
3c7ba18e32f1 [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6478
diff changeset
791 }
19904
8abf4c2056eb Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19859
diff changeset
792
34687
aebc4dd321bf Use GObject constructed for PurpleConversation, PurpleIMConversation and PurpleChatConversation
Ankit Vani <a@nevitus.org>
parents: 34684
diff changeset
793 static void
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
794 purple_conversation_class_init(PurpleConversationClass *klass) {
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
795 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
796
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
797 obj_class->constructed = purple_conversation_constructed;
36109
2e4dd08b0131 Conversations: fix glib warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 36108
diff changeset
798 obj_class->dispose = purple_conversation_dispose;
34646
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
799 obj_class->finalize = purple_conversation_finalize;
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
800 obj_class->get_property = purple_conversation_get_property;
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
801 obj_class->set_property = purple_conversation_set_property;
e7f4631e93f7 Begun adding GObject code to conversation sources
Ankit Vani <a@nevitus.org>
parents: 34622
diff changeset
802
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
803 /**
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
804 * PurpleConversation:id:
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
805 *
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
806 * An opaque identifier for this conversation. Generally speaking this is
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
807 * protocol dependent and should only be used as a unique identifier.
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
808 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
809 * Since: 3.0
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
810 */
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
811 properties[PROP_ID] = g_param_spec_string(
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
812 "id", "id",
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
813 "The identifier for the conversation.",
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
814 NULL,
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
815 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
816
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
817 /**
42800
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
818 * PurpleConversation:global-id:
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
819 *
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
820 * A libpurple global id for the conversation.
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
821 *
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
822 * This is an opaque value but it ties the conversation to the libpurple
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
823 * account it belongs to, which makes it globally unique inside of
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
824 * libpurple.
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
825 *
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
826 * Since: 3.0
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
827 */
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
828 properties[PROP_GLOBAL_ID] = g_param_spec_string(
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
829 "global-id", NULL, NULL,
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
830 NULL,
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
831 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
832
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
833 /**
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
834 * PurpleConversation:type:
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
835 *
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
836 * A type hint for the conversation. This may be useful for protocols, but
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
837 * libpurple treats all conversations the same.
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
838 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
839 * Since: 3.0
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
840 */
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
841 properties[PROP_TYPE] = g_param_spec_enum(
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
842 "type", "type",
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
843 "The type of the conversation.",
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
844 PURPLE_TYPE_CONVERSATION_TYPE,
42653
584895b844d2 PurpleConversationType's values were pascal case when they should be upper snake case
Gary Kramlich <grim@reaperworld.com>
parents: 42613
diff changeset
845 PURPLE_CONVERSATION_TYPE_UNSET,
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
846 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
847
42656
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
848 /**
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
849 * PurpleConversation:account:
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
850 *
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
851 * The account this conversation belongs to.
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
852 *
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
853 * Since: 3.0
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
854 */
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
855 properties[PROP_ACCOUNT] = g_param_spec_object(
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
856 "account", "Account",
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
857 "The account for the conversation.",
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
858 PURPLE_TYPE_ACCOUNT,
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
859 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
860
42355
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
861 /**
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
862 * PurpleConversation:avatar:
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
863 *
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
864 * The [class@Avatar] for the conversation.
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
865 *
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
866 * Not all protocols support this and most user interfaces will use the
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
867 * avatar of the remote contact for direct messages.
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
868 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
869 * Since: 3.0
42355
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
870 */
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
871 properties[PROP_AVATAR] = g_param_spec_object(
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
872 "avatar", "avatar",
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
873 "The avatar for this conversation.",
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
874 PURPLE_TYPE_AVATAR,
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
875 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
876
42656
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
877 /**
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
878 * PurpleConversation:name:
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
879 *
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
880 * The name of the conversation.
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
881 *
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
882 * Since: 3.0
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
883 */
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
884 properties[PROP_NAME] = g_param_spec_string(
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
885 "name", "Name",
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
886 "The name of the conversation.",
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
887 NULL,
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
888 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
889
42656
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
890 /**
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
891 * PurpleConversation:alias:
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
892 *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
893 * An alias for the conversation that is local to the libpurple user.
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
894 *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
895 * Since: 3.0
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
896 */
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
897 properties[PROP_ALIAS] = g_param_spec_string(
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
898 "alias", NULL, NULL,
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
899 NULL,
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
900 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
901
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
902 /**
42656
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
903 * PurpleConversation:title:
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
904 *
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
905 * The title of the conversation.
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
906 *
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
907 * Since: 3.0
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
908 */
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
909 properties[PROP_TITLE] = g_param_spec_string(
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
910 "title", "Title",
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
911 "The title of the conversation.",
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
912 NULL,
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
913 G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
914
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
915 /**
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
916 * PurpleConversation:title-for-display:
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
917 *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
918 * The title that should be displayed for the conversation based on which
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
919 * properties are set.
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
920 *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
921 * If [property@Conversation:alias] is set, that will be returned.
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
922 *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
923 * If alias is not set but [property@Conversation:title] is set, then value
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
924 * of title will be returned.
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
925 *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
926 * As a fallback, [property@Conversation:id] will be returned if nothing
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
927 * else is set.
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
928 *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
929 * Since: 3.0
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
930 */
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
931 properties[PROP_TITLE_FOR_DISPLAY] = g_param_spec_string(
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
932 "title-for-display", NULL, NULL,
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
933 NULL,
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
934 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
935
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
936 /**
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
937 * PurpleConversation:title-generated:
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
938 *
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
939 * Whether or not the title of the conversation was generated by
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
940 * [method@Conversation.generate_title].
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
941 *
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
942 * Note: This only works on DMs and GroupDMs.
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
943 *
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
944 * If this is %TRUE, [method@Conversation.generate_title] will
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
945 * automatically be called whenever a member is added or removed, or when
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
946 * their display name changes.
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
947 *
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
948 * Since: 3.0
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
949 */
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
950 properties[PROP_TITLE_GENERATED] = g_param_spec_boolean(
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
951 "title-generated", "title-generated",
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
952 "Whether or not the current title was generated.",
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
953 FALSE,
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
954 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
955
42656
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42654
diff changeset
956 /**
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
957 * PurpleConversation:age-restricted:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
958 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
959 * Whether or not the conversation is age restricted.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
960 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
961 * This is typically set only by a protocol plugin.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
962 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
963 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
964 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
965 properties[PROP_AGE_RESTRICTED] = g_param_spec_boolean(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
966 "age-restricted", "age-restricted",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
967 "Whether or not the conversation is age restricted.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
968 FALSE,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
969 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
970
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
971 /**
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
972 * PurpleConversation:description:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
973 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
974 * Sets the description of the conversation. This field is typically used
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
975 * to give more information about a conversation than that which would fit
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
976 * in [property@Conversation:topic].
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
977 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
978 * This is typically set only by a protocol plugin.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
979 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
980 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
981 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
982 properties[PROP_DESCRIPTION] = g_param_spec_string(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
983 "description", "description",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
984 "The description for the conversation.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
985 NULL,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
986 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
987
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
988 /**
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
989 * PurpleConversation:topic:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
990 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
991 * The topic of the conversation.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
992 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
993 * This is normally controlled by the protocol plugin and often times
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
994 * requires permission for the user to set.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
995 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
996 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
997 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
998 properties[PROP_TOPIC] = g_param_spec_string(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
999 "topic", "topic",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1000 "The topic for the conversation.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1001 NULL,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1002 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1003
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1004 /**
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1005 * PurpleConversation:topic-author:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1006 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1007 * Sets the author of the topic for the conversation.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1008 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1009 * This should typically only be set by a protocol plugin.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1010 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1011 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1012 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1013 properties[PROP_TOPIC_AUTHOR] = g_param_spec_object(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1014 "topic-author", "topic-author",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1015 "The author of the topic for the conversation.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1016 PURPLE_TYPE_CONTACT_INFO,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1017 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1018
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1019 /**
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1020 * PurpleConversation:topic-updated:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1021 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1022 * Set to the time that the topic was last updated.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1023 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1024 * This should typically only be set by a protocol plugin.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1025 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1026 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1027 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1028 properties[PROP_TOPIC_UPDATED] = g_param_spec_boxed(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1029 "topic-updated", "topic-updated",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1030 "The time when the topic was last updated for the conversation.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1031 G_TYPE_DATE_TIME,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1032 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1033
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1034 /**
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1035 * PurpleConversation:user-nickname:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1036 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1037 * The user's nickname in this conversation.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1038 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1039 * Some protocols allow the user to use a nickname rather than their normal
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1040 * contact information when joining a conversation. This field holds that
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1041 * value.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1042 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1043 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1044 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1045 properties[PROP_USER_NICKNAME] = g_param_spec_string(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1046 "user-nickname", "user-nickname",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1047 "The nickname for the user in the conversation.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1048 NULL,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1049 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1050
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1051 /**
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1052 * PurpleConversation:favorite:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1053 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1054 * Whether or not the conversation has been marked as favorite by the user.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1055 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1056 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1057 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1058 properties[PROP_FAVORITE] = g_param_spec_boolean(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1059 "favorite", "favorite",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1060 "Whether or not the conversation is a favorite.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1061 FALSE,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1062 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1063
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1064 /**
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1065 * PurpleConversation:created-on:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1066 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1067 * The [struct@GLib.DateTime] when this conversation was created. This can
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1068 * be %NULL if the value is not known or supported.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1069 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1070 * This should typically only be set by a protocol plugin.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1071 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1072 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1073 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1074 properties[PROP_CREATED_ON] = g_param_spec_boxed(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1075 "created-on", "created-on",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1076 "When the conversation was created.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1077 G_TYPE_DATE_TIME,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1078 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1079
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1080 /**
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1081 * PurpleConversation:creator:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1082 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1083 * The [class@ContactInfo] that created the conversation.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1084 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1085 * This should typically only be set by a protocol plugin.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1086 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1087 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1088 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1089 properties[PROP_CREATOR] = g_param_spec_object(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1090 "creator", "creator",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1091 "The contact info of who created the conversation.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1092 PURPLE_TYPE_CONTACT_INFO,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1093 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1094
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1095 /**
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1096 * PurpleConversation:online:
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1097 *
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1098 * Whether or not the conversation is able to send and receive messages.
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1099 *
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1100 * This is typically tied to whether or not the account that this
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1101 * conversation belongs is online or not.
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1102 *
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1103 * However, if a protocol supports federated conversation, it is possible
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1104 * for a conversation to be offline if the server it is on is currently
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1105 * unreachable.
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1106 *
42486
594f84a2c97f Fix some small doc issues
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42355
diff changeset
1107 * See also [property@Conversation:federated].
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1108 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1109 * Since: 3.0
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1110 */
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1111 properties[PROP_ONLINE] = g_param_spec_boolean(
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1112 "online", "online",
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1113 "Whether or not the conversation can send and receive messages.",
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1114 TRUE,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1115 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1116
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1117 /**
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1118 * PurpleConversation:federated:
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1119 *
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1120 * Whether or this conversation is federated.
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1121 *
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1122 * This should only be set by protocols that support federated
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1123 * conversations.
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1124 *
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1125 * When this is %TRUE the [property@Conversation:online] property will not
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1126 * be automatically set to match the [property@Account:connected] property
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1127 * of the account that this conversation belongs to. It is the
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1128 * responsibility of the protocol to manage the online property in this
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1129 * case.
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1130 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1131 * Since: 3.0
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1132 */
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1133 properties[PROP_FEDERATED] = g_param_spec_boolean(
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1134 "federated", "federated",
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1135 "Whether or not this conversation is federated.",
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1136 FALSE,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1137 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1138
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1139 /**
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1140 * PurpleConversation:tags:
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1141 *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1142 * [class@Tags] for the conversation.
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1143 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1144 * Since: 3.0
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1145 */
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1146 properties[PROP_TAGS] = g_param_spec_object(
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1147 "tags", "tags",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1148 "The tags for the conversation.",
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1149 PURPLE_TYPE_TAGS,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1150 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1151
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1152 /**
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1153 * PurpleConversation:members:
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1154 *
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1155 * The members that are currently in this conversation.
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1156 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1157 * Since: 3.0
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1158 */
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1159 properties[PROP_MEMBERS] = g_param_spec_object(
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1160 "members", "members",
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1161 "The members that are currently in this conversation",
42891
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
1162 PURPLE_TYPE_CONVERSATION_MEMBERS,
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1163 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1164
42299
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1165 /**
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1166 * PurpleConversation:messages:
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1167 *
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1168 * A [iface.Gio.ListModel] of all the messages in this conversation.
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1169 *
42613
780d7efe37c2 Remove the micro version from since tags for libpurple part 2
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
1170 * Since: 3.0
42299
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1171 */
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1172 properties[PROP_MESSAGES] = g_param_spec_object(
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1173 "messages", "messages",
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1174 "All of the messages in this conversation's history.",
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1175 G_TYPE_LIST_MODEL,
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1176 G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1177
42848
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1178 /**
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1179 * PurpleConversation:needs-attention:
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1180 *
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1181 * Whether or not the conversation needs attention.
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1182 *
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1183 * This could be because there are new messages or the user has been
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1184 * kicked from the room, or something else.
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1185 *
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1186 * Since: 3.0
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1187 */
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1188 properties[PROP_NEEDS_ATTENTION] = g_param_spec_boolean(
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1189 "needs-attention", NULL, NULL,
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1190 FALSE,
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1191 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1192
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1193 /**
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1194 * PurpleConversation:typing-state:
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1195 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1196 * The [enum@TypingState] of the libpurple user in this conversation.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1197 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1198 * When the property changes to `typing`, a timeout will be setup to change
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1199 * the property to `paused` if the property hasn't been set to `typing`
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1200 * again before the timeout expires.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1201 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1202 * If the above timeout fires, the state will be changed to `paused`, and a
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1203 * new timeout will be added that will reset the state to `none` if it
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1204 * expires.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1205 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1206 * This means that user interfaces should only ever need to set the state
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1207 * to typing and should do so whenever the user types anything that could
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1208 * be part of a message. Things like keyboard navigation and %commands
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1209 * should not result in this property being changed.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1210 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1211 * If the [class@Protocol] that this conversation belongs to implements
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1212 * [iface@ProtocolConversation] and
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1213 * [vfunc@ProtocolConversation.send_typing],
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1214 * [vfunc@ProtocolConversation.send_typing] will be called when this
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1215 * property is set even if the state hasn't changed.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1216 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1217 * Since: 3.0
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1218 */
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1219 properties[PROP_TYPING_STATE] = g_param_spec_enum(
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1220 "typing-state", NULL, NULL,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1221 PURPLE_TYPE_TYPING_STATE,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1222 PURPLE_TYPING_STATE_NONE,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1223 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1224
42908
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1225 /**
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1226 * PurpleConversation:logging:
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1227 *
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1228 * Whether or not this conversation is currently being logged.
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1229 *
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1230 * Since: 3.0
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1231 */
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1232 properties[PROP_LOGGING] = g_param_spec_boolean(
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1233 "logging", NULL, NULL,
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1234 FALSE,
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1235 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1236
42916
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1237 /**
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1238 * PurpleConversation:drafting:
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1239 *
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1240 * Whether or not the user has drafted a message for this conversation.
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1241 *
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1242 * This will not be set to false after a call to
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1243 * [method@Conversation.write_message] as anything can call that which
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1244 * could break the accounting of this property.
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1245 *
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1246 * Since: 3.0
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1247 */
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1248 properties[PROP_DRAFTING] = g_param_spec_boolean(
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1249 "drafting", NULL, NULL,
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1250 FALSE,
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1251 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
1252
43064
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1253 /**
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1254 * PurpleConversation:error:
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1255 *
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1256 * An error that was encountered in this conversation. For example, this could
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1257 * be a channel connection error or a kick message.
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1258 *
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1259 * Since: 3.0
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1260 */
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1261 properties[PROP_ERROR] = g_param_spec_boxed(
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1262 "error", NULL, NULL,
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1263 G_TYPE_ERROR,
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1264 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
1265
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1266 g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1267
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1268 /**
42736
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1269 * PurpleConversation::present:
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1270 * @conversation: The instance.
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1271 *
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1272 * Emitted by [method@Conversation.present] when something wants the
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1273 * conversation presented to the user.
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1274 *
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1275 * Since: 3.0
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1276 */
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1277 signals[SIG_PRESENT] = g_signal_new_class_handler(
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1278 "present",
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1279 G_OBJECT_CLASS_TYPE(klass),
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1280 G_SIGNAL_RUN_LAST,
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1281 NULL,
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1282 NULL,
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1283 NULL,
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1284 NULL,
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1285 G_TYPE_NONE,
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1286 0);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1287 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1288
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1289 /******************************************************************************
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1290 * Public API
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1291 *****************************************************************************/
42669
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1292 gboolean
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1293 purple_conversation_is_dm(PurpleConversation *conversation) {
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1294 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1295
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1296 return conversation->type == PURPLE_CONVERSATION_TYPE_DM;
42669
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1297 }
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1298
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1299 gboolean
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1300 purple_conversation_is_group_dm(PurpleConversation *conversation) {
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1301 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1302
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1303 return conversation->type == PURPLE_CONVERSATION_TYPE_GROUP_DM;
42669
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1304 }
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1305
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1306 gboolean
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1307 purple_conversation_is_channel(PurpleConversation *conversation) {
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1308 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1309
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1310 return conversation->type == PURPLE_CONVERSATION_TYPE_CHANNEL;
42669
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1311 }
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1312
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1313 gboolean
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1314 purple_conversation_is_thread(PurpleConversation *conversation) {
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1315 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1316
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1317 return conversation->type == PURPLE_CONVERSATION_TYPE_THREAD;
42669
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1318 }
6d41b29637ef Add some "is" methods to PurpleConversation to make type checking easier
Gary Kramlich <grim@reaperworld.com>
parents: 42656
diff changeset
1319
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1320 void
42736
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1321 purple_conversation_present(PurpleConversation *conversation) {
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1322 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1323
630084f39cc5 Add a present signal to PurpleConversation and propagate it from PurpleConversationManager
Gary Kramlich <grim@reaperworld.com>
parents: 42735
diff changeset
1324 g_signal_emit(conversation, signals[SIG_PRESENT], 0);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1325 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1326
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
1327 const char *
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
1328 purple_conversation_get_id(PurpleConversation *conversation) {
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
1329 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
1330
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1331 return conversation->id;
42272
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
1332 }
015257326ad4 Add an id property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42258
diff changeset
1333
42800
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1334 char *
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1335 purple_conversation_get_global_id(PurpleConversation *conversation) {
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1336 const char *account_id = NULL;
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1337
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1338 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1339
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1340 account_id = purple_account_get_id(conversation->account);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1341
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1342 return g_strdup_printf("%s-%s", account_id, conversation->id);
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1343 }
5c55680a1a6b Add Purple.Conversation:global-id
Gary Kramlich <grim@reaperworld.com>
parents: 42778
diff changeset
1344
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
1345 PurpleConversationType
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
1346 purple_conversation_get_conversation_type(PurpleConversation *conversation) {
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
1347 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation),
42653
584895b844d2 PurpleConversationType's values were pascal case when they should be upper snake case
Gary Kramlich <grim@reaperworld.com>
parents: 42613
diff changeset
1348 PURPLE_CONVERSATION_TYPE_UNSET);
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
1349
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1350 return conversation->type;
42316
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
1351 }
3985c3404f20 Add PurpleConversationType
Gary Kramlich <grim@reaperworld.com>
parents: 42302
diff changeset
1352
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1353 PurpleAccount *
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1354 purple_conversation_get_account(PurpleConversation *conversation) {
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1355 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1356
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1357 return conversation->account;
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1358 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1359
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1360 PurpleConnection *
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1361 purple_conversation_get_connection(PurpleConversation *conversation) {
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1362 PurpleAccount *account;
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1363
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1364 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1365
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1366 account = purple_conversation_get_account(conversation);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1367
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1368 if(account == NULL) {
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1369 return NULL;
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1370 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1371
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1372 return purple_account_get_connection(account);
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1373 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1374
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1375 void
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1376 purple_conversation_set_title(PurpleConversation *conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1377 const char *title)
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1378 {
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1379 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1380
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42760
diff changeset
1381 if(g_set_str(&conversation->title, title)) {
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1382 GObject *obj = G_OBJECT(conversation);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1383
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1384 /* We have to g_object_freeze_notify here because we're modifying more
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1385 * than one property. However, purple_conversation_generate_title will
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1386 * also have called g_object_freeze_notify before calling us because it
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1387 * needs to set the title-generated property to TRUE even though we set
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1388 * it to FALSE here. We do this, because we didn't want to write
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1389 * additional API that skips that part.
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1390 */
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1391 g_object_freeze_notify(obj);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1392 g_object_notify_by_pspec(obj, properties[PROP_TITLE]);
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1393 g_object_notify_by_pspec(obj, properties[PROP_TITLE_FOR_DISPLAY]);
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1394 purple_conversation_set_title_generated(conversation, FALSE);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1395 g_object_thaw_notify(obj);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1396 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1397 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1398
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1399 const char *
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1400 purple_conversation_get_title(PurpleConversation *conversation) {
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1401 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1402
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1403 return conversation->title;
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1404 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1405
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1406 void
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1407 purple_conversation_generate_title(PurpleConversation *conversation) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1408 PurpleAccount *account = NULL;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1409 PurpleContactInfo *account_info = NULL;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1410 GString *str = NULL;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1411 guint n_members = 0;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1412 gboolean first = TRUE;
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1413
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1414 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1415
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1416 if(conversation->type != PURPLE_CONVERSATION_TYPE_DM &&
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1417 conversation->type != PURPLE_CONVERSATION_TYPE_GROUP_DM)
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1418 {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1419 g_warning("purple_conversation_generate_title called for non DM/Group "
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1420 "DM conversation");
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1421
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1422 return;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1423 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1424
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1425 account = purple_conversation_get_account(conversation);
42805
3e77e81168a5 Update libpurple to use get id and username directly on PurpleAccount
Gary Kramlich <grim@reaperworld.com>
parents: 42800
diff changeset
1426 account_info = purple_account_get_contact_info(account);
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1427
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1428 str = g_string_new("");
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1429
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1430 n_members = g_list_model_get_n_items(G_LIST_MODEL(conversation->members));
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1431 for(guint i = 0; i < n_members; i++) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1432 PurpleContactInfo *info = NULL;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1433 PurpleConversationMember *member = NULL;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1434 const char *name = NULL;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1435
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1436 member = g_list_model_get_item(G_LIST_MODEL(conversation->members), i);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1437 info = purple_conversation_member_get_contact_info(member);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1438 if(purple_contact_info_compare(info, account_info) == 0) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1439 g_clear_object(&member);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1440
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1441 continue;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1442 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1443
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1444 name = purple_contact_info_get_name_for_display(info);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1445 if(purple_strempty(name)) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1446 g_warning("contact %p has no displayable name", info);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1447
42760
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1448 g_clear_object(&member);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1449
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1450 continue;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1451 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1452
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1453 if(!first) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1454 g_string_append_printf(str, ", %s", name);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1455 } else {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1456 g_string_append(str, name);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1457 first = FALSE;
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1458 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1459
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1460 g_clear_object(&member);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1461 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1462
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1463 /* If we found at least 1 user to add, then we set the title. */
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1464 if(!first) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1465 GObject *obj = G_OBJECT(conversation);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1466
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1467 g_object_freeze_notify(obj);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1468 purple_conversation_set_title(conversation, str->str);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1469 purple_conversation_set_title_generated(conversation, TRUE);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1470 g_object_thaw_notify(obj);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1471 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1472
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1473 g_string_free(str, TRUE);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1474 }
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1475
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1476 gboolean
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1477 purple_conversation_get_title_generated(PurpleConversation *conversation) {
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1478 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1479
0c293ecd56c2 Automatically generate titles for DMs and GroupDMs
Gary Kramlich <grim@reaperworld.com>
parents: 42756
diff changeset
1480 return conversation->title_generated;
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1481 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1482
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1483 void
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1484 purple_conversation_set_name(PurpleConversation *conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1485 const char *name)
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1486 {
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1487 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1488
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42760
diff changeset
1489 if(g_set_str(&conversation->name, name)) {
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1490 g_object_notify_by_pspec(G_OBJECT(conversation),
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1491 properties[PROP_NAME]);
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1492 }
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1493 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1494
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1495 const char *
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1496 purple_conversation_get_name(PurpleConversation *conversation) {
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1497 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1498
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1499 return conversation->name;
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1500 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1501
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1502 void
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1503 purple_conversation_write_message(PurpleConversation *conversation,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1504 PurpleMessage *message)
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1505 {
43017
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1506 PurpleContactInfo *info = NULL;
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1507
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1508 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1509 g_return_if_fail(message != NULL);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1510
42908
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
1511 if(conversation->logging) {
41090
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1512 GError *error = NULL;
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1513 PurpleHistoryManager *manager = NULL;
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1514 gboolean success = FALSE;
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1515
41090
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1516 manager = purple_history_manager_get_default();
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1517 /* We should probably handle this error somehow, but I don't think that
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1518 * spamming purple_debug_warning is necessarily the right call.
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1519 */
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1520 success = purple_history_manager_write(manager, conversation, message,
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1521 &error);
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1522 if(!success){
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1523 purple_debug_info("conversation",
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1524 "history manager write returned error: %s",
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1525 error->message);
41090
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1526
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1527 g_clear_error(&error);
741992355ead GSoC History API including sqlite history adapter
James Culver <rewtguy@gmail.com>
parents: 41083
diff changeset
1528 }
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1529 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1530
43017
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1531 info = purple_message_get_author(message);
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1532 if(PURPLE_IS_CONTACT_INFO(info)) {
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1533 PurpleConversationMember *member = NULL;
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1534 PurpleConversationMembers *members = NULL;
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1535
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1536 members = purple_conversation_get_members(conversation);
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1537 member = purple_conversation_members_find_member(members, info);
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1538 if(PURPLE_IS_CONVERSATION_MEMBER(member)) {
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1539 purple_conversation_member_set_typing_state(member,
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1540 PURPLE_TYPING_STATE_NONE,
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1541 0);
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1542 }
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1543 }
09661a988eab When writing a message make sure the author's typing state is set to none
Gary Kramlich <grim@reaperworld.com>
parents: 42999
diff changeset
1544
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1545 g_list_store_append(conversation->messages, message);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1546 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1547
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1548 void
42743
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1549 purple_conversation_send_message_async(PurpleConversation *conversation,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1550 PurpleMessage *message,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1551 GCancellable *cancellable,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1552 GAsyncReadyCallback callback,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1553 gpointer data)
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1554 {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1555 PurpleAccount *account = NULL;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1556 PurpleProtocol *protocol = NULL;
43056
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1557 PurpleProtocolConversation *protocol_conversation = NULL;
42743
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1558 GTask *task = NULL;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1559
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1560 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1561 g_return_if_fail(PURPLE_IS_MESSAGE(message));
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1562
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1563 purple_conversation_set_typing_state(conversation,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1564 PURPLE_TYPING_STATE_NONE);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1565
42743
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1566 task = g_task_new(conversation, cancellable, callback, data);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1567 g_task_set_source_tag(task, purple_conversation_send_message_async);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1568 g_task_set_task_data(task, g_object_ref(message), g_object_unref);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1569
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1570 account = purple_conversation_get_account(conversation);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1571 protocol = purple_account_get_protocol(account);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1572
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1573 if(!PURPLE_IS_PROTOCOL_CONVERSATION(protocol)) {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1574 g_task_return_new_error(task, PURPLE_CONVERSATION_DOMAIN, 0,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1575 "protocol does not implement "
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1576 "PurpleProtocolConversation");
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1577
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1578 g_clear_object(&task);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1579
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1580 return;
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1581 }
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1582
43056
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1583 protocol_conversation = PURPLE_PROTOCOL_CONVERSATION(protocol);
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1584 if(!purple_protocol_conversation_implements_send_message(protocol_conversation))
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1585 {
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1586 g_task_return_new_error(task, PURPLE_CONVERSATION_DOMAIN, 0,
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1587 "protocol does not implement "
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1588 "PurpleProtocolConversation.send_message");
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1589
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1590 g_clear_object(&task);
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1591
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1592 return;
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1593 }
49358391e695 Add Purple.ProtocolConversation.implements_send_message
Gary Kramlich <grim@reaperworld.com>
parents: 43018
diff changeset
1594
42743
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1595 purple_protocol_conversation_send_message_async(PURPLE_PROTOCOL_CONVERSATION(protocol),
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1596 conversation,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1597 message,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1598 cancellable,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1599 purple_conversation_send_message_async_cb,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1600 task);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1601 }
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1602
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1603 gboolean
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1604 purple_conversation_send_message_finish(PurpleConversation *conversation,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1605 GAsyncResult *result,
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1606 GError **error)
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1607 {
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1608 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1609 g_return_val_if_fail(G_IS_ASYNC_RESULT(result), FALSE);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1610
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1611 g_return_val_if_fail(g_task_get_source_tag(G_TASK(result)) !=
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1612 purple_conversation_send_message_async, FALSE);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1613
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1614 return g_task_propagate_boolean(G_TASK(result), error);
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1615 }
bcc726c6c61a Add purple_conversation_send_message_async and _finish
Gary Kramlich <grim@reaperworld.com>
parents: 42740
diff changeset
1616
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1617 gboolean
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1618 purple_conversation_has_focus(PurpleConversation *conversation) {
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1619 gboolean ret = FALSE;
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1620
42735
441ec6ccbd93 A bunch of random cleanups for PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42734
diff changeset
1621 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
40854
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1622
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1623 return ret;
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1624 }
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1625
f1b7c03f6cc7 Use G_DECLARE_DERIVABLE_TYPE for PurpleConversation and additional cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40853
diff changeset
1626 gboolean
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1627 purple_conversation_get_age_restricted(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1628 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1629
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1630 return conversation->age_restricted;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1631 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1632
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1633 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1634 purple_conversation_set_age_restricted(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1635 gboolean age_restricted)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1636 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1637 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1638
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1639 if(conversation->age_restricted != age_restricted) {
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1640 conversation->age_restricted = age_restricted;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1641
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1642 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1643 properties[PROP_AGE_RESTRICTED]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1644 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1645 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1646
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1647 const char *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1648 purple_conversation_get_description(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1649 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1650
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1651 return conversation->description;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1652 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1653
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1654 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1655 purple_conversation_set_description(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1656 const char *description)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1657 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1658 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1659
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42760
diff changeset
1660 if(g_set_str(&conversation->description, description)) {
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1661 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1662 properties[PROP_DESCRIPTION]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1663 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1664 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1665
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1666 const char *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1667 purple_conversation_get_topic(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1668 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1669
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1670 return conversation->topic;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1671 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1672
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1673 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1674 purple_conversation_set_topic(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1675 const char *topic)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1676 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1677 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1678
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42760
diff changeset
1679 if(g_set_str(&conversation->topic, topic)) {
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1680 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1681 properties[PROP_TOPIC]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1682 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1683 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1684
42302
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1685 void
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1686 purple_conversation_set_topic_full(PurpleConversation *conversation,
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1687 const char *topic,
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1688 PurpleContactInfo *author,
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1689 GDateTime *updated)
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1690 {
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1691 GObject *obj = NULL;
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1692
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1693 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1694
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1695 obj = G_OBJECT(conversation);
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1696 g_object_freeze_notify(obj);
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1697
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1698 purple_conversation_set_topic(conversation, topic);
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1699 purple_conversation_set_topic_author(conversation, author);
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1700 purple_conversation_set_topic_updated(conversation, updated);
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1701
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1702 g_object_thaw_notify(obj);
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1703 }
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1704
54e2bf5af34a Add purple_conversation_set_topic_full
Gary Kramlich <grim@reaperworld.com>
parents: 42299
diff changeset
1705
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1706 PurpleContactInfo *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1707 purple_conversation_get_topic_author(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1708 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1709
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1710 return conversation->topic_author;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1711 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1712
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1713 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1714 purple_conversation_set_topic_author(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1715 PurpleContactInfo *author)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1716 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1717 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1718
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1719 if(g_set_object(&conversation->topic_author, author)) {
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1720 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1721 properties[PROP_TOPIC_AUTHOR]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1722 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1723 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1724
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1725 GDateTime *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1726 purple_conversation_get_topic_updated(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1727 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1728
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1729 return conversation->topic_updated;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1730 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1731
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1732 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1733 purple_conversation_set_topic_updated(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1734 GDateTime *updated)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1735 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1736 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1737
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1738 if(birb_date_time_set(&conversation->topic_updated, updated)) {
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1739 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1740 properties[PROP_TOPIC_UPDATED]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1741 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1742 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1743
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1744 const char *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1745 purple_conversation_get_user_nickname(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1746 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1747
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1748 return conversation->user_nickname;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1749 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1750
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1751 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1752 purple_conversation_set_user_nickname(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1753 const char *nickname)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1754 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1755 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1756
42767
8cf1d11b59c1 Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42760
diff changeset
1757 if(g_set_str(&conversation->user_nickname, nickname)) {
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1758 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1759 properties[PROP_USER_NICKNAME]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1760 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1761 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1762
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1763 gboolean
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1764 purple_conversation_get_favorite(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1765 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1766
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1767 return conversation->favorite;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1768 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1769
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1770 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1771 purple_conversation_set_favorite(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1772 gboolean favorite)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1773 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1774 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1775
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1776 if(conversation->favorite != favorite) {
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1777 conversation->favorite = favorite;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1778
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1779 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1780 properties[PROP_FAVORITE]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1781 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1782 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1783
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1784 GDateTime *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1785 purple_conversation_get_created_on(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1786 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1787
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1788 return conversation->created_on;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1789 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1790
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1791 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1792 purple_conversation_set_created_on(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1793 GDateTime *created_on)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1794 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1795 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1796
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1797 if(birb_date_time_set(&conversation->created_on, created_on)) {
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1798 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1799 properties[PROP_CREATED_ON]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1800 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1801 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1802
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1803 PurpleContactInfo *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1804 purple_conversation_get_creator(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1805 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1806
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1807 return conversation->creator;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1808 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1809
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1810 void
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1811 purple_conversation_set_creator(PurpleConversation *conversation,
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1812 PurpleContactInfo *creator)
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1813 {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1814 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1815
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1816 if(g_set_object(&conversation->creator, creator)) {
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1817 g_object_notify_by_pspec(G_OBJECT(conversation),
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1818 properties[PROP_CREATOR]);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1819 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1820 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1821
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1822 gboolean
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1823 purple_conversation_get_online(PurpleConversation *conversation) {
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1824 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1825
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1826 return conversation->online;
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1827 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1828
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1829 void
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1830 purple_conversation_set_online(PurpleConversation *conversation,
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1831 gboolean online)
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1832 {
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1833 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1834
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1835 if(conversation->online != online) {
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1836 conversation->online = online;
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1837
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1838 g_object_notify_by_pspec(G_OBJECT(conversation),
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1839 properties[PROP_ONLINE]);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1840 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1841 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1842
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1843 gboolean
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1844 purple_conversation_get_federated(PurpleConversation *conversation) {
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1845 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1846
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1847 return conversation->federated;
42318
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1848 }
3b05e7088b61 Add online and federated properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42316
diff changeset
1849
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1850 PurpleTags *
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1851 purple_conversation_get_tags(PurpleConversation *conversation) {
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1852 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1853
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1854 return conversation->tags;
42292
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1855 }
5bc9561e5f2b Add a bunch of properties to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
1856
42891
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
1857 PurpleConversationMembers *
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1858 purple_conversation_get_members(PurpleConversation *conversation) {
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1859 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1860
42891
7f8daf96e7d3 Move Purple.Conversation:members to Purple.ConversationMembers
Gary Kramlich <grim@reaperworld.com>
parents: 42887
diff changeset
1861 return conversation->members;
42114
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1862 }
d3fe2b899c89 Add membership management to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42070
diff changeset
1863
42299
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1864 GListModel *
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1865 purple_conversation_get_messages(PurpleConversation *conversation) {
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1866 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1867
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1868 if(G_IS_LIST_MODEL(conversation->messages)) {
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1869 return G_LIST_MODEL(conversation->messages);
42299
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1870 }
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1871
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1872 return NULL;
2dce52f93848 Add a "messages" property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42298
diff changeset
1873 }
42355
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1874
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1875 PurpleAvatar *
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1876 purple_conversation_get_avatar(PurpleConversation *conversation) {
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1877 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1878
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1879 return conversation->avatar;
42355
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1880 }
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1881
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1882 void
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1883 purple_conversation_set_avatar(PurpleConversation *conversation,
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1884 PurpleAvatar *avatar)
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1885 {
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1886 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1887
42734
4e0eef85cd80 Make PurpleConversation final
Gary Kramlich <grim@reaperworld.com>
parents: 42732
diff changeset
1888 if(g_set_object(&conversation->avatar, avatar)) {
42355
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1889 g_object_notify_by_pspec(G_OBJECT(conversation),
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1890 properties[PROP_AVATAR]);
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1891 }
6f7c6b84aaa0 Add an avatar property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42321
diff changeset
1892 }
42773
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1893
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1894 const char *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1895 purple_conversation_get_title_for_display(PurpleConversation *conversation) {
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1896 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1897
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1898 if(!purple_strempty(conversation->alias)) {
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1899 return conversation->alias;
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1900 }
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1901
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1902 if(!purple_strempty(conversation->title)) {
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1903 return conversation->title;
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1904 }
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1905
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1906 return conversation->id;
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1907 }
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1908
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1909 const char *
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1910 purple_conversation_get_alias(PurpleConversation *conversation) {
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1911 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1912
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1913 return conversation->alias;
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1914 }
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1915
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1916 void
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1917 purple_conversation_set_alias(PurpleConversation *conversation,
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1918 const char *alias)
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1919 {
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1920 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1921
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1922 if(g_set_str(&conversation->alias, alias)) {
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1923 GObject *obj = G_OBJECT(conversation);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1924
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1925 g_object_freeze_notify(obj);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1926 g_object_notify_by_pspec(obj, properties[PROP_ALIAS]);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1927 g_object_notify_by_pspec(obj, properties[PROP_TITLE_FOR_DISPLAY]);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1928 g_object_thaw_notify(obj);
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1929 }
2718698a94b9 Add Conversation:alias and Conversation:title-for-display properties
Gary Kramlich <grim@reaperworld.com>
parents: 42767
diff changeset
1930 }
42848
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1931
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1932 gboolean
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1933 purple_conversation_get_needs_attention(PurpleConversation *conversation) {
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1934 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1935
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1936 return conversation->needs_attention;
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1937 }
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1938
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1939 void
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1940 purple_conversation_set_needs_attention(PurpleConversation *conversation,
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1941 gboolean needs_attention)
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1942 {
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1943 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1944
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1945 if(conversation->needs_attention != needs_attention) {
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1946 conversation->needs_attention = needs_attention;
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1947
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1948 g_object_notify_by_pspec(G_OBJECT(conversation),
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1949 properties[PROP_NEEDS_ATTENTION]);
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1950 }
f9a04b0bed1f Add a needs-attention property to PurpleConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42839
diff changeset
1951 }
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1952
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1953 PurpleTypingState
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1954 purple_conversation_get_typing_state(PurpleConversation *conversation) {
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1955 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation),
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1956 PURPLE_TYPING_STATE_NONE);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1957
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1958 return conversation->typing_state;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1959 }
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1960
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1961 void
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1962 purple_conversation_set_typing_state(PurpleConversation *conversation,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1963 PurpleTypingState typing_state)
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1964 {
42894
7d128a161cad Only send the typing notifications if it's changed or if it's TYPING
Gary Kramlich <grim@reaperworld.com>
parents: 42891
diff changeset
1965 gboolean send = FALSE;
7d128a161cad Only send the typing notifications if it's changed or if it's TYPING
Gary Kramlich <grim@reaperworld.com>
parents: 42891
diff changeset
1966
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1967 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1968
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1969 /* Remove the old timeout because we have new activity. */
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1970 g_clear_handle_id(&conversation->typing_state_source, g_source_remove);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1971
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1972 /* We set some default timeouts based on the state. If the new state is
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1973 * TYPING, we use a 6 second timeout that will change the state to PAUSED.
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1974 * When the state changes to PAUSED we will set a 30 second timeout that
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1975 * will change the state to NONE.
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1976 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1977 * This allows the user interface to just tell libpurple when the user is
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1978 * typing, and the rest happens automatically.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1979 */
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1980 if(typing_state == PURPLE_TYPING_STATE_TYPING) {
42902
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1981 GDateTime *now = NULL;
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1982
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
1983 conversation->typing_state_source =
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1984 g_timeout_add_seconds_once(6,
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1985 purple_conversation_typing_state_typing_cb,
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1986 conversation);
42902
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1987
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1988 /* We don't want to spam services with typing notifications, so we only
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1989 * send them if it's been at least 3 seconds since the last one was
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1990 * sent.
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1991 *
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
1992 * Use local time because this is local to the user and we might want
42902
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1993 * to output this during debug or something, and a local time stamp
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1994 * will make a lot more sense then.
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1995 */
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1996 now = g_date_time_new_now_local();
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1997 if(conversation->last_typing != NULL) {
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1998 GTimeSpan difference = 0;
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
1999
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
2000 difference = g_date_time_difference(now, conversation->last_typing);
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
2001 birb_date_time_clear(&conversation->last_typing);
42902
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
2002
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
2003 if(difference >= 3 * G_TIME_SPAN_SECOND) {
42902
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
2004 send = TRUE;
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
2005 }
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
2006 }
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
2007
fc235710664e Only send typing notifications if we haven't sent on in 3 seconds
Gary Kramlich <grim@reaperworld.com>
parents: 42895
diff changeset
2008 conversation->last_typing = now;
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2009 } else if(typing_state == PURPLE_TYPING_STATE_PAUSED) {
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2010 conversation->typing_state_source =
42939
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
2011 g_timeout_add_seconds_once(30,
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
2012 purple_conversation_typing_state_paused_cb,
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
2013 conversation);
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
2014 } else if(typing_state == PURPLE_TYPING_STATE_NONE) {
4921f19b1b7b Clean up some stuff in the typing code
Gary Kramlich <grim@reaperworld.com>
parents: 42916
diff changeset
2015 birb_date_time_clear(&conversation->last_typing);
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2016 }
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2017
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2018 if(conversation->typing_state != typing_state) {
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2019 conversation->typing_state = typing_state;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2020
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2021 g_object_notify_by_pspec(G_OBJECT(conversation),
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2022 properties[PROP_TYPING_STATE]);
42894
7d128a161cad Only send the typing notifications if it's changed or if it's TYPING
Gary Kramlich <grim@reaperworld.com>
parents: 42891
diff changeset
2023
7d128a161cad Only send the typing notifications if it's changed or if it's TYPING
Gary Kramlich <grim@reaperworld.com>
parents: 42891
diff changeset
2024 /* The state changed so we need to send it. */
7d128a161cad Only send the typing notifications if it's changed or if it's TYPING
Gary Kramlich <grim@reaperworld.com>
parents: 42891
diff changeset
2025 send = TRUE;
7d128a161cad Only send the typing notifications if it's changed or if it's TYPING
Gary Kramlich <grim@reaperworld.com>
parents: 42891
diff changeset
2026 }
7d128a161cad Only send the typing notifications if it's changed or if it's TYPING
Gary Kramlich <grim@reaperworld.com>
parents: 42891
diff changeset
2027
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2028 /* Check if we have a protocol that implements
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2029 * ProtocolConversation.send_typing and call it if it does.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2030 *
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2031 * We do this after the notify above to make sure the user interface will
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2032 * not be possibly blocked by the protocol.
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2033 */
42894
7d128a161cad Only send the typing notifications if it's changed or if it's TYPING
Gary Kramlich <grim@reaperworld.com>
parents: 42891
diff changeset
2034 if(send && PURPLE_IS_ACCOUNT(conversation->account)) {
42884
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2035 PurpleProtocol *protocol = NULL;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2036
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2037 protocol = purple_account_get_protocol(conversation->account);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2038 if(PURPLE_IS_PROTOCOL_CONVERSATION(protocol)) {
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2039 PurpleProtocolConversation *protocol_conversation = NULL;
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2040
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2041 protocol_conversation = PURPLE_PROTOCOL_CONVERSATION(protocol);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2042
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2043 if(purple_protocol_conversation_implements_send_typing(protocol_conversation))
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2044 {
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2045 purple_protocol_conversation_send_typing(protocol_conversation,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2046 conversation,
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2047 conversation->typing_state);
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2048 }
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2049 }
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2050 }
5a7d425c9d1b Add a typing-state property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42857
diff changeset
2051 }
42908
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2052
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2053 gboolean
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2054 purple_conversation_get_logging(PurpleConversation *conversation) {
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2055 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2056
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2057 return conversation->logging;
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2058 }
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2059
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2060 void
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2061 purple_conversation_set_logging(PurpleConversation *conversation,
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2062 gboolean logging)
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2063 {
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2064 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2065
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2066 if(conversation->logging != logging) {
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2067 conversation->logging = logging;
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2068
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2069 g_object_notify_by_pspec(G_OBJECT(conversation),
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2070 properties[PROP_LOGGING]);
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2071 }
64bbb9d4bf94 Add a logging property to Purple.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 42902
diff changeset
2072 }
42916
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2073
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2074 gboolean
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2075 purple_conversation_get_drafting(PurpleConversation *conversation) {
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2076 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), FALSE);
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2077
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2078 return conversation->drafting;
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2079 }
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2080
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2081 void
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2082 purple_conversation_set_drafting(PurpleConversation *conversation,
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2083 gboolean drafting)
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2084 {
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2085 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2086
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2087 if(conversation->drafting != drafting) {
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2088 conversation->drafting = drafting;
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2089
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2090 g_object_notify_by_pspec(G_OBJECT(conversation),
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2091 properties[PROP_DRAFTING]);
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2092 }
28a4480fe746 Add Purple.Conversation:drafting
Gary Kramlich <grim@reaperworld.com>
parents: 42908
diff changeset
2093 }
43064
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2094
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2095 GError *
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2096 purple_conversation_get_error(PurpleConversation *conversation) {
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2097 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2098
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2099 return conversation->error;
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2100 }
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2101
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2102 void
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2103 purple_conversation_set_error(PurpleConversation *conversation,
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2104 GError *error)
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2105 {
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2106 g_return_if_fail(PURPLE_IS_CONVERSATION(conversation));
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2107
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2108 g_clear_error(&conversation->error);
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2109 if(error != NULL) {
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2110 conversation->error = g_error_copy(error);
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2111 }
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2112
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2113 g_object_notify_by_pspec(G_OBJECT(conversation), properties[PROP_ERROR]);
ac5311a8f11e Add PurpleConversation:error property
Markus Fischer <ivanhoe@fiscari.de>
parents: 43056
diff changeset
2114 }

mercurial