/soc/2013/ankitkv/gobjectification: 8dd17abe4901: Set presence p...
Ankit Vani
a at nevitus.org
Sat Jul 20 17:22:37 EDT 2013
Changeset: 8dd17abe49016d090bd1733509b6998f36d8815b
Author: Ankit Vani <a at nevitus.org>
Date: 2013-07-21 02:52 +0530
Branch: soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/8dd17abe4901
Description:
Set presence property "active-status" directly
diffstat:
libpurple/presences.c | 7 ++-----
libpurple/status.c | 3 +--
2 files changed, 3 insertions(+), 7 deletions(-)
diffs (38 lines):
diff --git a/libpurple/presences.c b/libpurple/presences.c
--- a/libpurple/presences.c
+++ b/libpurple/presences.c
@@ -334,6 +334,7 @@ purple_presence_set_property(GObject *ob
GParamSpec *pspec)
{
PurplePresence *presence = PURPLE_PRESENCE(obj);
+ PurplePresencePrivate *priv = PURPLE_PRESENCE_GET_PRIVATE(presence);
switch (param_id) {
case PRES_PROP_IDLE:
@@ -358,12 +359,8 @@ purple_presence_set_property(GObject *ob
#endif
break;
case PRES_PROP_ACTIVE_STATUS:
- {
#warning TODO: change get_pointer to get_object when PurpleStatus is a GObject
- PurpleStatus *status = g_value_get_pointer(value);
- purple_presence_set_status_active(presence,
- purple_status_get_id(status), TRUE);
- }
+ priv->active_status = g_value_get_pointer(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
diff --git a/libpurple/status.c b/libpurple/status.c
--- a/libpurple/status.c
+++ b/libpurple/status.c
@@ -622,8 +622,7 @@ status_has_changed(PurpleStatus *status)
old_status = purple_presence_get_active_status(presence);
if (old_status != NULL && (old_status != status))
old_status->active = FALSE;
- purple_presence_set_status_active(presence, purple_status_get_id(status),
- TRUE);
+ g_object_set(presence, "active-status", status, NULL);
}
else
old_status = NULL;
More information about the Commits
mailing list