Mon, 04 Sep 2023 23:44:44 -0500
Add a notifications-disabled property to PurplePresence
This allows user interfaces to tell the user whether or not their contacts will
be notified of new messages.
Testing Done:
Ran the unit tests under valgrind.
Bugs closed: PIDGIN-17829
Reviewed at https://reviews.imfreedom.org/r/2603/
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
1 | /* |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
2 | * purple |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
4 | * |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
7 | * source distribution. |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
8 | * |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
13 | * |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
18 | * |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
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 | |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
25 | #include "purplepresence.h" |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
26 | |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
27 | #include "debug.h" |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
28 | #include "purpleenums.h" |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40195
diff
changeset
|
29 | #include "purpleprivate.h" |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
30 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
31 | typedef struct { |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
32 | gboolean idle; |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
33 | GDateTime *idle_time; |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
34 | GDateTime *login_time; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
35 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
36 | GHashTable *status_table; |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
37 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
38 | PurpleStatus *active_status; |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
39 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
40 | PurplePresencePrimitive primitive; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
41 | char *message; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
42 | char *emoji; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
43 | gboolean mobile; |
|
42310
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
44 | gboolean notifications_disabled; |
|
39538
00ee7c55cd54
Re-group presence type definitions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39435
diff
changeset
|
45 | } PurplePresencePrivate; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
46 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
47 | enum { |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
48 | PROP_0, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
49 | PROP_IDLE, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
50 | PROP_IDLE_TIME, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
51 | PROP_LOGIN_TIME, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
52 | PROP_ACTIVE_STATUS, |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
53 | PROP_PRIMITIVE, |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
54 | PROP_MESSAGE, |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
55 | PROP_EMOJI, |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
56 | PROP_MOBILE, |
|
42310
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
57 | PROP_NOTIFICATIONS_DISABLED, |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
58 | N_PROPERTIES |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
59 | }; |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
60 | static GParamSpec *properties[N_PROPERTIES]; |
|
39538
00ee7c55cd54
Re-group presence type definitions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39435
diff
changeset
|
61 | |
|
00ee7c55cd54
Re-group presence type definitions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39435
diff
changeset
|
62 | G_DEFINE_TYPE_WITH_PRIVATE(PurplePresence, purple_presence, G_TYPE_OBJECT) |
|
00ee7c55cd54
Re-group presence type definitions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39435
diff
changeset
|
63 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
64 | /****************************************************************************** |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
65 | * Helpers |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
66 | *****************************************************************************/ |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
67 | static void |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
68 | purple_presence_set_active_status(PurplePresence *presence, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
69 | PurpleStatus *status) |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
70 | { |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
71 | PurplePresencePrivate *priv = NULL; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
72 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
73 | priv = purple_presence_get_instance_private(presence); |
|
39538
00ee7c55cd54
Re-group presence type definitions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39435
diff
changeset
|
74 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
75 | if(g_set_object(&priv->active_status, status)) { |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
76 | GObject *obj = G_OBJECT(presence); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
77 | |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
78 | g_object_freeze_notify(obj); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
79 | g_object_notify_by_pspec(obj, properties[PROP_ACTIVE_STATUS]); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
80 | g_object_notify_by_pspec(obj, properties[PROP_PRIMITIVE]); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
81 | g_object_notify_by_pspec(obj, properties[PROP_MESSAGE]); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
82 | g_object_thaw_notify(obj); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
83 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
84 | } |
|
39539
f221f88ff0b0
Use G_DECLARE* for Purple*Presence types.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39538
diff
changeset
|
85 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
86 | /****************************************************************************** |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
87 | * GObject Implementation |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
88 | *****************************************************************************/ |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
89 | static void |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
90 | purple_presence_set_property(GObject *obj, guint param_id, const GValue *value, |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
91 | GParamSpec *pspec) |
|
34836
289bc0df25bb
API changes for PurplePresence. See details.
Ankit Vani <a@nevitus.org>
parents:
34834
diff
changeset
|
92 | { |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
93 | PurplePresence *presence = PURPLE_PRESENCE(obj); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
94 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
95 | switch (param_id) { |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
96 | case PROP_IDLE: |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
97 | purple_presence_set_idle(presence, g_value_get_boolean(value), |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
98 | NULL); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
99 | break; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
100 | case PROP_IDLE_TIME: |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
101 | purple_presence_set_idle(presence, TRUE, g_value_get_boxed(value)); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
102 | break; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
103 | case PROP_LOGIN_TIME: |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
104 | purple_presence_set_login_time(presence, g_value_get_boxed(value)); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
105 | break; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
106 | case PROP_ACTIVE_STATUS: |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
107 | purple_presence_set_active_status(presence, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
108 | g_value_get_object(value)); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
109 | break; |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
110 | case PROP_PRIMITIVE: |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
111 | purple_presence_set_primitive(presence, g_value_get_enum(value)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
112 | break; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
113 | case PROP_MESSAGE: |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
114 | purple_presence_set_message(presence, g_value_get_string(value)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
115 | break; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
116 | case PROP_EMOJI: |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
117 | purple_presence_set_emoji(presence, g_value_get_string(value)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
118 | break; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
119 | case PROP_MOBILE: |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
120 | purple_presence_set_mobile(presence, g_value_get_boolean(value)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
121 | break; |
|
42310
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
122 | case PROP_NOTIFICATIONS_DISABLED: |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
123 | purple_presence_set_notifications_disabled(presence, |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
124 | g_value_get_boolean(value)); |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
125 | break; |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
126 | default: |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
127 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
128 | break; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
129 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
130 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
131 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
132 | static void |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
133 | purple_presence_get_property(GObject *obj, guint param_id, GValue *value, |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
134 | GParamSpec *pspec) |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
135 | { |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
136 | PurplePresence *presence = PURPLE_PRESENCE(obj); |
|
39538
00ee7c55cd54
Re-group presence type definitions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39435
diff
changeset
|
137 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
138 | switch (param_id) { |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
139 | case PROP_IDLE: |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
140 | g_value_set_boolean(value, purple_presence_is_idle(presence)); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
141 | break; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
142 | case PROP_IDLE_TIME: |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
143 | g_value_set_boxed(value, purple_presence_get_idle_time(presence)); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
144 | break; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
145 | case PROP_LOGIN_TIME: |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
146 | g_value_set_boxed(value, purple_presence_get_login_time(presence)); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
147 | break; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
148 | case PROP_ACTIVE_STATUS: |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
149 | g_value_set_object(value, purple_presence_get_active_status(presence)); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
150 | break; |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
151 | case PROP_PRIMITIVE: |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
152 | g_value_set_enum(value, purple_presence_get_primitive(presence)); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
153 | break; |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
154 | case PROP_MESSAGE: |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
155 | g_value_set_string(value, purple_presence_get_message(presence)); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
156 | break; |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
157 | case PROP_EMOJI: |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
158 | g_value_set_string(value, purple_presence_get_emoji(presence)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
159 | break; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
160 | case PROP_MOBILE: |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
161 | g_value_set_boolean(value, purple_presence_get_mobile(presence)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
162 | break; |
|
42310
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
163 | case PROP_NOTIFICATIONS_DISABLED: |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
164 | g_value_set_boolean(value, |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
165 | purple_presence_get_notifications_disabled(presence)); |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
166 | break; |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
167 | default: |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
168 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
169 | break; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
170 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
171 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
172 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
173 | static void |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
174 | purple_presence_init(PurplePresence *presence) { |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
175 | PurplePresencePrivate *priv = NULL; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
176 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
177 | priv = purple_presence_get_instance_private(presence); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
178 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
179 | priv->status_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
180 | NULL); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
181 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
182 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
183 | static void |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
184 | purple_presence_finalize(GObject *obj) { |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
185 | PurplePresencePrivate *priv = NULL; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
186 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
187 | priv = purple_presence_get_instance_private(PURPLE_PRESENCE(obj)); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
188 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
189 | g_hash_table_destroy(priv->status_table); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
190 | g_clear_object(&priv->active_status); |
|
39539
f221f88ff0b0
Use G_DECLARE* for Purple*Presence types.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39538
diff
changeset
|
191 | |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
192 | g_clear_pointer(&priv->idle_time, g_date_time_unref); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
193 | g_clear_pointer(&priv->login_time, g_date_time_unref); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
194 | |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
195 | g_clear_pointer(&priv->message, g_free); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
196 | g_clear_pointer(&priv->emoji, g_free); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
197 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
198 | G_OBJECT_CLASS(purple_presence_parent_class)->finalize(obj); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
199 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
200 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
201 | static void |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
202 | purple_presence_class_init(PurplePresenceClass *klass) { |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
203 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
204 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
205 | obj_class->get_property = purple_presence_get_property; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
206 | obj_class->set_property = purple_presence_set_property; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
207 | obj_class->finalize = purple_presence_finalize; |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
208 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
209 | /** |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
210 | * PurplePresence:idle: |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
211 | * |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
212 | * Whether or not the presence is in an idle state. |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
213 | */ |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
214 | properties[PROP_IDLE] = g_param_spec_boolean("idle", "Idle", |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
215 | "Whether the presence is in idle state.", FALSE, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
216 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
217 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
218 | /** |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
219 | * PurplePresence:idle-time: |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
220 | * |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
221 | * The time when the presence went idle. |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
222 | */ |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
223 | properties[PROP_IDLE_TIME] = g_param_spec_boxed( |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
224 | "idle-time", "Idle time", |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
225 | "The idle time of the presence", |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
226 | G_TYPE_DATE_TIME, |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
227 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
228 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
229 | /** |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
230 | * PurplePresence:login-time: |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
231 | * |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
232 | * The login-time of the presence. |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
233 | */ |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
234 | properties[PROP_LOGIN_TIME] = g_param_spec_boxed( |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
235 | "login-time", "Login time", |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
236 | "The login time of the presence.", |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
237 | G_TYPE_DATE_TIME, |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
238 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
39435
b30e04a71ecf
Use G_DEFINE_TYPE_WITH_PRIVATE for Purple*Presence.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
239 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
240 | /** |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
241 | * PurplePresence:active-status: |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
242 | * |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
243 | * The currently active status of the presence. |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
244 | */ |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
245 | properties[PROP_ACTIVE_STATUS] = g_param_spec_object("active-status", |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
246 | "Active status", |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
247 | "The active status for the presence.", PURPLE_TYPE_STATUS, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
248 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
249 | |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
250 | /** |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
251 | * PurplePresence:primitive: |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
252 | * |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
253 | * The [enum@Purple.StatusPrimitive] for this presence. |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
254 | * |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
255 | * Since: 3.0.0 |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
256 | */ |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
257 | properties[PROP_PRIMITIVE] = g_param_spec_enum( |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
258 | "primitive", "primitive", |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
259 | "The primitive for the presence", |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
260 | PURPLE_TYPE_PRESENCE_PRIMITIVE, |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
261 | PURPLE_PRESENCE_PRIMITIVE_OFFLINE, |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
262 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
263 | |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
264 | /** |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
265 | * PurplePresence:message: |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
266 | * |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
267 | * The status message of the presence. |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
268 | * |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
269 | * Since: 3.0.0 |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
270 | */ |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
271 | properties[PROP_MESSAGE] = g_param_spec_string( |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
272 | "message", "message", |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
273 | "The status message", |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
274 | NULL, |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
275 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
276 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
277 | /** |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
278 | * PurplePresence:emoji: |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
279 | * |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
280 | * The emoji or mood of the presence. |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
281 | * |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
282 | * Since: 3.0.0 |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
283 | */ |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
284 | properties[PROP_EMOJI] = g_param_spec_string( |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
285 | "emoji", "emoji", |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
286 | "The emoji for the presence.", |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
287 | NULL, |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
288 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
289 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
290 | /** |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
291 | * PurplePresence:mobile: |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
292 | * |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
293 | * Whether or not the presence is on a mobile device. |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
294 | * |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
295 | * Since: 3.0.0 |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
296 | */ |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
297 | properties[PROP_MOBILE] = g_param_spec_boolean( |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
298 | "mobile", "mobile", |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
299 | "Whether or not the presence is on a mobile device.", |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
300 | FALSE, |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
301 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
302 | |
|
42310
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
303 | /** |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
304 | * PurplePresence:notifications-disabled: |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
305 | * |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
306 | * Whether or not the presence has notifications disabled. |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
307 | * |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
308 | * Some protocols, like Slack, allow users to set an available schedule. By |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
309 | * default it displays that the user has notifications turned off outside |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
310 | * of that schedule. |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
311 | * |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
312 | * Since: 3.0.0 |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
313 | */ |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
314 | properties[PROP_NOTIFICATIONS_DISABLED] = g_param_spec_boolean( |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
315 | "notifications-disabled", "notifications-disabled", |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
316 | "Whether or not this presence has notifications disabled.", |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
317 | FALSE, |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
318 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
319 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
320 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
321 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
322 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
323 | /****************************************************************************** |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
324 | * Public API |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
325 | *****************************************************************************/ |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
326 | PurplePresence * |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
327 | purple_presence_new(void) { |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
328 | return g_object_new(PURPLE_TYPE_PRESENCE, NULL); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
329 | } |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
330 | |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
331 | void |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
332 | purple_presence_set_status_active(PurplePresence *presence, |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
333 | const gchar *status_id, gboolean active) |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
334 | { |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
335 | PurpleStatus *status = NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
336 | |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
337 | g_return_if_fail(PURPLE_IS_PRESENCE(presence)); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
338 | g_return_if_fail(status_id != NULL); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
339 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
340 | status = purple_presence_get_status(presence, status_id); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
341 | |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
342 | g_return_if_fail(PURPLE_IS_STATUS(status)); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
343 | /* TODO: Should we do the following? */ |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
344 | /* g_return_if_fail(active == status->active); */ |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
345 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
346 | if(purple_status_is_exclusive(status)) { |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
347 | if(!active) { |
|
35176
b0659f31989d
Update debug categories for new filenames
Ankit Vani <a@nevitus.org>
parents:
35091
diff
changeset
|
348 | purple_debug_warning("presence", |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
349 | "Attempted to set a non-independent status " |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
350 | "(%s) inactive. Only independent statuses " |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
351 | "can be specifically marked inactive.", |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
352 | status_id); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
353 | return; |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
354 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
355 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
356 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
357 | purple_status_set_active(status, active); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
358 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
359 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
360 | void |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
361 | purple_presence_switch_status(PurplePresence *presence, const gchar *status_id) |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
362 | { |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
363 | purple_presence_set_status_active(presence, status_id, TRUE); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
364 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
365 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
366 | void |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
367 | purple_presence_set_idle(PurplePresence *presence, gboolean idle, |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
368 | GDateTime *idle_time) |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
369 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
370 | PurplePresencePrivate *priv = NULL; |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
371 | PurplePresenceClass *klass = NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
372 | gboolean old_idle; |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
373 | GObject *obj = NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
374 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
375 | g_return_if_fail(PURPLE_IS_PRESENCE(presence)); |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
376 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
377 | priv = purple_presence_get_instance_private(presence); |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
378 | klass = PURPLE_PRESENCE_GET_CLASS(presence); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
379 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
380 | if (priv->idle == idle && priv->idle_time == idle_time) { |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
381 | return; |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
382 | } |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
383 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
384 | old_idle = priv->idle; |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
385 | priv->idle = idle; |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
386 | |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
387 | g_clear_pointer(&priv->idle_time, g_date_time_unref); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
388 | if(idle && idle_time != NULL) { |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
389 | priv->idle_time = g_date_time_ref(idle_time); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
390 | } |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
391 | |
|
35066
f997e5384f79
libpurple: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
35058
diff
changeset
|
392 | obj = G_OBJECT(presence); |
|
f997e5384f79
libpurple: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
35058
diff
changeset
|
393 | g_object_freeze_notify(obj); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
394 | g_object_notify_by_pspec(obj, properties[PROP_IDLE]); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
395 | g_object_notify_by_pspec(obj, properties[PROP_IDLE_TIME]); |
|
35066
f997e5384f79
libpurple: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
35058
diff
changeset
|
396 | g_object_thaw_notify(obj); |
|
f997e5384f79
libpurple: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
35058
diff
changeset
|
397 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
398 | if(klass->update_idle) { |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
399 | klass->update_idle(presence, old_idle); |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
400 | } |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
401 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
402 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
403 | void |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
404 | purple_presence_set_login_time(PurplePresence *presence, GDateTime *login_time) |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
405 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
406 | PurplePresencePrivate *priv = NULL; |
|
34847
770ba2679b24
Refactored presence.c and status.c to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34846
diff
changeset
|
407 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
408 | g_return_if_fail(PURPLE_IS_PRESENCE(presence)); |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
409 | |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
410 | priv = purple_presence_get_instance_private(presence); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
411 | |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
412 | if(priv->login_time != NULL && login_time != NULL) { |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
413 | if(g_date_time_equal(priv->login_time, login_time)) { |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
414 | return; |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
415 | } |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
416 | } |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
417 | |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
418 | if(priv->login_time != NULL) { |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
419 | g_date_time_unref(priv->login_time); |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
420 | } |
|
35013
4718438d053b
Cleaned up properties and added g_object_notify calls for everything else
Ankit Vani <a@nevitus.org>
parents:
34986
diff
changeset
|
421 | |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
422 | if(login_time != NULL) { |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
423 | priv->login_time = g_date_time_ref(login_time); |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
424 | } else { |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
425 | priv->login_time = NULL; |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
426 | } |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
427 | |
|
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
428 | g_object_notify_by_pspec(G_OBJECT(presence), properties[PROP_LOGIN_TIME]); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
429 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
430 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
431 | GList * |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
432 | purple_presence_get_statuses(PurplePresence *presence) { |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
433 | PurplePresenceClass *klass = NULL; |
|
34847
770ba2679b24
Refactored presence.c and status.c to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34846
diff
changeset
|
434 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
435 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), NULL); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
436 | |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
437 | klass = PURPLE_PRESENCE_GET_CLASS(presence); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
438 | if(klass && klass->get_statuses) { |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
439 | return klass->get_statuses(presence); |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
440 | } |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
441 | |
|
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
442 | return NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
443 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
444 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
445 | PurpleStatus * |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
446 | purple_presence_get_status(PurplePresence *presence, const gchar *status_id) { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
447 | PurplePresencePrivate *priv = NULL; |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
448 | PurpleStatus *status = NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
449 | GList *l = NULL; |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
450 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
451 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), NULL); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
452 | g_return_val_if_fail(status_id != NULL, NULL); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
453 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
454 | priv = purple_presence_get_instance_private(presence); |
|
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
455 | |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
456 | /* What's the purpose of this hash table? */ |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
457 | status = (PurpleStatus *)g_hash_table_lookup(priv->status_table, |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
458 | status_id); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
459 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
460 | if(status == NULL) { |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
461 | for(l = purple_presence_get_statuses(presence); |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
462 | l != NULL && status == NULL; l = l->next) |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
463 | { |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
464 | PurpleStatus *temp_status = l->data; |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
465 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
466 | if (purple_strequal(status_id, purple_status_get_id(temp_status))) { |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
467 | status = temp_status; |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
468 | } |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
469 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
470 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
471 | if(status != NULL) { |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
472 | g_hash_table_insert(priv->status_table, |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
473 | g_strdup(purple_status_get_id(status)), status); |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
474 | } |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
475 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
476 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
477 | return status; |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
478 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
479 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
480 | PurpleStatus * |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
481 | purple_presence_get_active_status(PurplePresence *presence) { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
482 | PurplePresencePrivate *priv = NULL; |
|
34847
770ba2679b24
Refactored presence.c and status.c to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34846
diff
changeset
|
483 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
484 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), NULL); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
485 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
486 | priv = purple_presence_get_instance_private(presence); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
487 | |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
488 | return priv->active_status; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
489 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
490 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
491 | gboolean |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
492 | purple_presence_is_available(PurplePresence *presence) { |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
493 | PurpleStatus *status = NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
494 | |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
495 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), FALSE); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
496 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
497 | status = purple_presence_get_active_status(presence); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
498 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
499 | return ((status != NULL && purple_status_is_available(status)) && |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
500 | !purple_presence_is_idle(presence)); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
501 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
502 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
503 | gboolean |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
504 | purple_presence_is_online(PurplePresence *presence) { |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
505 | PurpleStatus *status = NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
506 | |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
507 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), FALSE); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
508 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
509 | if((status = purple_presence_get_active_status(presence)) == NULL) { |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
510 | return FALSE; |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
511 | } |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
512 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
513 | return purple_status_is_online(status); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
514 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
515 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
516 | gboolean |
|
39435
b30e04a71ecf
Use G_DEFINE_TYPE_WITH_PRIVATE for Purple*Presence.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
517 | purple_presence_is_status_active(PurplePresence *presence, |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
518 | const gchar *status_id) |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
519 | { |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
520 | PurpleStatus *status = NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
521 | |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
522 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), FALSE); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
523 | g_return_val_if_fail(status_id != NULL, FALSE); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
524 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
525 | status = purple_presence_get_status(presence, status_id); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
526 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
527 | return (status != NULL && purple_status_is_active(status)); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
528 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
529 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
530 | gboolean |
|
39435
b30e04a71ecf
Use G_DEFINE_TYPE_WITH_PRIVATE for Purple*Presence.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
531 | purple_presence_is_status_primitive_active(PurplePresence *presence, |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
532 | PurpleStatusPrimitive primitive) |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
533 | { |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
534 | GList *l = NULL; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
535 | |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
536 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), FALSE); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
537 | g_return_val_if_fail(primitive != PURPLE_STATUS_UNSET, FALSE); |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
538 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
539 | for(l = purple_presence_get_statuses(presence); l != NULL; l = l->next) { |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
540 | PurpleStatus *temp_status = l->data; |
|
34855
9c289149eed4
Global replaces according to GObject status API
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
541 | PurpleStatusType *type = purple_status_get_status_type(temp_status); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
542 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
543 | if(purple_status_type_get_primitive(type) == primitive && |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
544 | purple_status_is_active(temp_status)) |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
545 | { |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
546 | return TRUE; |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
547 | } |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
548 | } |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
549 | |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
550 | return FALSE; |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
551 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
552 | |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
553 | gboolean |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
554 | purple_presence_is_idle(PurplePresence *presence) { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
555 | PurplePresencePrivate *priv = NULL; |
|
34847
770ba2679b24
Refactored presence.c and status.c to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34846
diff
changeset
|
556 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
557 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), FALSE); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
558 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
559 | if(!purple_presence_is_online(presence)) { |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
560 | return FALSE; |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
561 | } |
|
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
562 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
563 | priv = purple_presence_get_instance_private(presence); |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
564 | |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
565 | return priv->idle; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
566 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
567 | |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
568 | GDateTime * |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
569 | purple_presence_get_idle_time(PurplePresence *presence) { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
570 | PurplePresencePrivate *priv = NULL; |
|
34847
770ba2679b24
Refactored presence.c and status.c to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34846
diff
changeset
|
571 | |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
572 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), NULL); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
573 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
574 | priv = purple_presence_get_instance_private(presence); |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
575 | |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
576 | return priv->idle_time; |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
577 | } |
|
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
578 | |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
579 | GDateTime * |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40441
diff
changeset
|
580 | purple_presence_get_login_time(PurplePresence *presence) { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
581 | PurplePresencePrivate *priv = NULL; |
|
34847
770ba2679b24
Refactored presence.c and status.c to use the GObject PurplePresence API
Ankit Vani <a@nevitus.org>
parents:
34846
diff
changeset
|
582 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
583 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), 0); |
|
34834
f45f0745da61
Started GObjectification of PurplePresence.
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
584 | |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
585 | priv = purple_presence_get_instance_private(presence); |
|
40575
b82c365e04e8
Rename presence.[ch] to purplepresence.[ch], fix some docs, and other tweaks.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
586 | |
|
41963
d140e4f6bb02
Move the PurplePresence::login-time property from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41740
diff
changeset
|
587 | return priv->login_time; |
|
34846
dea8dd8343d5
Added GObject code to presenses.c.
Ankit Vani <a@nevitus.org>
parents:
34840
diff
changeset
|
588 | } |
|
41740
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
589 | |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
590 | gint |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
591 | purple_presence_compare(PurplePresence *presence1, PurplePresence *presence2) { |
|
42270
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
592 | PurplePresencePrimitive primitive1 = PURPLE_PRESENCE_PRIMITIVE_OFFLINE; |
|
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
593 | PurplePresencePrimitive primitive2 = PURPLE_PRESENCE_PRIMITIVE_OFFLINE; |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
594 | GDateTime *idle1 = NULL; |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
595 | GDateTime *idle2 = NULL; |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
596 | GDateTime *now = NULL; |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
597 | GTimeSpan diff1 = 0; |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
598 | GTimeSpan diff2 = 0; |
|
41740
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
599 | |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
600 | if(presence1 == presence2) { |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
601 | return 0; |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
602 | } else if (presence1 == NULL) { |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
603 | return 1; |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
604 | } else if (presence2 == NULL) { |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
605 | return -1; |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
606 | } |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
607 | |
|
42270
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
608 | primitive1 = purple_presence_get_primitive(presence1); |
|
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
609 | primitive2 = purple_presence_get_primitive(presence2); |
|
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
610 | |
|
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
611 | if(primitive1 != PURPLE_PRESENCE_PRIMITIVE_OFFLINE && |
|
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
612 | primitive2 == PURPLE_PRESENCE_PRIMITIVE_OFFLINE) |
|
41740
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
613 | { |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
614 | return -1; |
|
42270
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
615 | } else if(primitive1 == PURPLE_PRESENCE_PRIMITIVE_OFFLINE && |
|
1bdd57a0c0d1
Propagate notify signals from the priority contact of a person
Gary Kramlich <grim@reaperworld.com>
parents:
42200
diff
changeset
|
616 | primitive2 != PURPLE_PRESENCE_PRIMITIVE_OFFLINE) |
|
41740
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
617 | { |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
618 | return 1; |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
619 | } |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
620 | |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
621 | idle1 = purple_presence_get_idle_time(presence1); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
622 | idle2 = purple_presence_get_idle_time(presence2); |
|
41740
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
623 | |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
624 | if(idle1 == NULL && idle2 == NULL) { |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
625 | return 0; |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
626 | } else if(idle1 == NULL && idle2 != NULL) { |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
627 | return -1; |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
628 | } else if(idle1 != NULL && idle2 == NULL) { |
|
41740
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
629 | return 1; |
|
42071
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
630 | } |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
631 | |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
632 | now = g_date_time_new_now_local(); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
633 | diff1 = g_date_time_difference(now, idle1); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
634 | diff2 = g_date_time_difference(now, idle2); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
635 | g_date_time_unref(now); |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
636 | |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
637 | if(diff1 > diff2) { |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
638 | return 1; |
|
a719f0f3c600
Convert idle_time in PurplePresence to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
42051
diff
changeset
|
639 | } else if (diff1 < diff2) { |
|
41740
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
640 | return -1; |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
641 | } |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
642 | |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
643 | return 0; |
|
d8fcd2907c3d
Add purple_presence_compare
Gary Kramlich <grim@reaperworld.com>
parents:
40575
diff
changeset
|
644 | } |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
645 | |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
646 | PurplePresencePrimitive |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
647 | purple_presence_get_primitive(PurplePresence *presence) { |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
648 | PurplePresencePrivate *priv = NULL; |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
649 | |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
650 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
651 | PURPLE_PRESENCE_PRIMITIVE_OFFLINE); |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
652 | |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
653 | priv = purple_presence_get_instance_private(presence); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
654 | |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
655 | return priv->primitive; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
656 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
657 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
658 | void |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
659 | purple_presence_set_primitive(PurplePresence *presence, |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
660 | PurplePresencePrimitive primitive) |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
661 | { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
662 | PurplePresencePrivate *priv = NULL; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
663 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
664 | g_return_if_fail(PURPLE_IS_PRESENCE(presence)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
665 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
666 | priv = purple_presence_get_instance_private(presence); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
667 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
668 | if(priv->primitive != primitive) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
669 | priv->primitive = primitive; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
670 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
671 | g_object_notify_by_pspec(G_OBJECT(presence), |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
672 | properties[PROP_PRIMITIVE]); |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
673 | } |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
674 | } |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
675 | |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
676 | const char * |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
677 | purple_presence_get_message(PurplePresence *presence) { |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
678 | PurplePresencePrivate *priv = NULL; |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
679 | |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
680 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), NULL); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
681 | |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
682 | priv = purple_presence_get_instance_private(presence); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
683 | |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
684 | if(priv->message != NULL) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
685 | return priv->message; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
686 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
687 | |
|
42200
c68c3ce47da8
Fix some issues where we were triggering GWarnings with presence
Gary Kramlich <grim@reaperworld.com>
parents:
42177
diff
changeset
|
688 | if(priv->active_status == NULL) { |
|
c68c3ce47da8
Fix some issues where we were triggering GWarnings with presence
Gary Kramlich <grim@reaperworld.com>
parents:
42177
diff
changeset
|
689 | return NULL; |
|
c68c3ce47da8
Fix some issues where we were triggering GWarnings with presence
Gary Kramlich <grim@reaperworld.com>
parents:
42177
diff
changeset
|
690 | } |
|
c68c3ce47da8
Fix some issues where we were triggering GWarnings with presence
Gary Kramlich <grim@reaperworld.com>
parents:
42177
diff
changeset
|
691 | |
|
42051
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
692 | return purple_status_get_attr_string(priv->active_status, "message"); |
|
18adb1710a54
Add read-only properties for primitive and message to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
41963
diff
changeset
|
693 | } |
|
42173
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
694 | |
|
42177
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
695 | void |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
696 | purple_presence_set_message(PurplePresence *presence, const char *message) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
697 | PurplePresencePrivate *priv = NULL; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
698 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
699 | g_return_if_fail(PURPLE_IS_PRESENCE(presence)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
700 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
701 | priv = purple_presence_get_instance_private(presence); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
702 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
703 | if(!purple_strequal(priv->message, message)) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
704 | g_free(priv->message); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
705 | priv->message = g_strdup(message); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
706 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
707 | g_object_notify_by_pspec(G_OBJECT(presence), properties[PROP_MESSAGE]); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
708 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
709 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
710 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
711 | const char * |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
712 | purple_presence_get_emoji(PurplePresence *presence) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
713 | PurplePresencePrivate *priv = NULL; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
714 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
715 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), NULL); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
716 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
717 | priv = purple_presence_get_instance_private(presence); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
718 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
719 | return priv->emoji; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
720 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
721 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
722 | void |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
723 | purple_presence_set_emoji(PurplePresence *presence, const char *emoji) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
724 | PurplePresencePrivate *priv = NULL; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
725 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
726 | g_return_if_fail(PURPLE_IS_PRESENCE(presence)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
727 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
728 | priv = purple_presence_get_instance_private(presence); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
729 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
730 | if(!purple_strequal(priv->emoji, emoji)) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
731 | g_free(priv->emoji); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
732 | priv->emoji = g_strdup(emoji); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
733 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
734 | g_object_notify_by_pspec(G_OBJECT(presence), properties[PROP_EMOJI]); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
735 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
736 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
737 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
738 | gboolean |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
739 | purple_presence_get_mobile(PurplePresence *presence) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
740 | PurplePresencePrivate *priv = NULL; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
741 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
742 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), FALSE); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
743 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
744 | priv = purple_presence_get_instance_private(presence); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
745 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
746 | return priv->mobile; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
747 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
748 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
749 | void |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
750 | purple_presence_set_mobile(PurplePresence *presence, gboolean mobile) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
751 | PurplePresencePrivate *priv = NULL; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
752 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
753 | g_return_if_fail(PURPLE_IS_PRESENCE(presence)); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
754 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
755 | priv = purple_presence_get_instance_private(presence); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
756 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
757 | if(priv->mobile != mobile) { |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
758 | priv->mobile = mobile; |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
759 | |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
760 | g_object_notify_by_pspec(G_OBJECT(presence), properties[PROP_MOBILE]); |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
761 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
762 | } |
|
d5722fdbdf86
Add "new-status" properties to PurplePresence with fallbacks were applicable
Gary Kramlich <grim@reaperworld.com>
parents:
42173
diff
changeset
|
763 | |
|
42310
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
764 | gboolean |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
765 | purple_presence_get_notifications_disabled(PurplePresence *presence) { |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
766 | PurplePresencePrivate *priv = NULL; |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
767 | |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
768 | g_return_val_if_fail(PURPLE_IS_PRESENCE(presence), FALSE); |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
769 | |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
770 | priv = purple_presence_get_instance_private(presence); |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
771 | |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
772 | return priv->notifications_disabled; |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
773 | } |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
774 | |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
775 | void |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
776 | purple_presence_set_notifications_disabled(PurplePresence *presence, |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
777 | gboolean notifications_disabled) |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
778 | { |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
779 | PurplePresencePrivate *priv = NULL; |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
780 | |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
781 | g_return_if_fail(PURPLE_IS_PRESENCE(presence)); |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
782 | |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
783 | priv = purple_presence_get_instance_private(presence); |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
784 | |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
785 | if(priv->notifications_disabled != notifications_disabled) { |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
786 | priv->notifications_disabled = notifications_disabled; |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
787 | |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
788 | g_object_notify_by_pspec(G_OBJECT(presence), |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
789 | properties[PROP_NOTIFICATIONS_DISABLED]); |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
790 | } |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
791 | } |
|
eea341b0d614
Add a notifications-disabled property to PurplePresence
Gary Kramlich <grim@reaperworld.com>
parents:
42270
diff
changeset
|
792 | |
|
42173
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
793 | const char * |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
794 | purple_presence_primitive_to_string(PurplePresencePrimitive primitive) { |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
795 | switch(primitive) { |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
796 | case PURPLE_PRESENCE_PRIMITIVE_OFFLINE: |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
797 | return _("Offline"); |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
798 | break; |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
799 | case PURPLE_PRESENCE_PRIMITIVE_AVAILABLE: |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
800 | return _("Available"); |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
801 | break; |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
802 | case PURPLE_PRESENCE_PRIMITIVE_IDLE: |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
803 | return _("Idle"); |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
804 | break; |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
805 | case PURPLE_PRESENCE_PRIMITIVE_INVISIBLE: |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
806 | return _("Invisible"); |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
807 | break; |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
808 | case PURPLE_PRESENCE_PRIMITIVE_AWAY: |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
809 | return _("Away"); |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
810 | break; |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
811 | case PURPLE_PRESENCE_PRIMITIVE_EXTENDED_AWAY: |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
812 | return _("Do not disturb"); |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
813 | break; |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
814 | case PURPLE_PRESENCE_PRIMITIVE_STREAMING: |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
815 | return _("Streaming"); |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
816 | break; |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
817 | default: |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
818 | return _("Unknown"); |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
819 | break; |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
820 | } |
|
50558d740eff
Add purple_presence_primitive_to_string for easier display
Gary Kramlich <grim@reaperworld.com>
parents:
42071
diff
changeset
|
821 | } |