rpms/telepathy-gabble/OLPC-2 gabble-muc-properties.patch, NONE, 1.1 gabble-pep-notifications.patch, NONE, 1.1 telepathy-gabble.spec, 1.48, 1.49
Dafydd Harries (daf)
fedora-extras-commits at redhat.com
Wed Dec 5 17:17:03 UTC 2007
Author: daf
Update of /cvs/pkgs/rpms/telepathy-gabble/OLPC-2
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6951
Modified Files:
telepathy-gabble.spec
Added Files:
gabble-muc-properties.patch gabble-pep-notifications.patch
Log Message:
* Wed Dec 05 2007 Dafydd Harries <dafydd.harries at collabora.co.uk> - 0.7.1-0.4.olpc3
- dev.laptop.org #5223: Add patch from upstream so that echoed PEP
notifications are ignored.
- dev.laptop.org #5224: Add patch from upstream for improved handling og MUC
properties.
gabble-muc-properties.patch:
--- NEW FILE gabble-muc-properties.patch ---
diff -rN -u old-telepathy-gabble-openfire/src/gabble-muc-channel.c new-telepathy-gabble-openfire/src/gabble-muc-channel.c
--- old-telepathy-gabble-openfire/src/gabble-muc-channel.c 2007-11-30 14:39:35.000000000 +0100
+++ new-telepathy-gabble-openfire/src/gabble-muc-channel.c 2007-11-30 14:39:35.000000000 +0100
@@ -2528,13 +2528,12 @@
for (node = form_node->children; node; node = node->next)
{
- const gchar *var, *prev_value;
- LmMessageNode *field_node, *value_node;
+ const gchar *var;
+ LmMessageNode *field_node;
guint id;
GType type;
gboolean invert;
- gchar buf[16];
- const gchar *val_str;
+ const gchar *val_str = NULL, *type_str;
gboolean val_bool;
if (strcmp (node->name, "field") != 0)
@@ -2550,33 +2549,9 @@
continue;
}
- value_node = lm_message_node_get_child (node, "value");
- if (value_node == NULL)
- {
- DEBUG ("skipping var '%s' because of lacking value attribute",
- var);
- continue;
- }
-
- prev_value = lm_message_node_get_value (value_node);
-
- /* add the corresponding field node to the reply message */
- field_node = lm_message_node_add_child (submit_node, "field", NULL);
-
- lm_message_node_set_attribute (field_node, "var", var);
-
- val_str = lm_message_node_get_attribute (node, "type");
- if (val_str)
- {
- lm_message_node_set_attribute (field_node, "type", val_str);
- }
-
- value_node = lm_message_node_add_child (field_node, "value", prev_value);
-
id = INVALID_ROOM_PROP;
type = G_TYPE_BOOLEAN;
invert = FALSE;
- val_str = NULL;
if (strcmp (var, "anonymous") == 0)
{
@@ -2663,39 +2638,68 @@
else
{
g_warning ("%s: ignoring field '%s'", G_STRFUNC, var);
- continue;
}
- DEBUG ("looking up %s... has=%d", room_property_signatures[id].name,
- tp_properties_context_has (ctx, id));
+ /* add the corresponding field node to the reply message */
+ field_node = lm_message_node_add_child (submit_node, "field", NULL);
+ lm_message_node_set_attribute (field_node, "var", var);
- if (!tp_properties_context_has (ctx, id))
- continue;
+ type_str = lm_message_node_get_attribute (node, "type");
+ if (type_str)
+ {
+ lm_message_node_set_attribute (field_node, "type", type_str);
+ }
- if (!val_str)
+ if (id != INVALID_ROOM_PROP && tp_properties_context_has (ctx, id))
{
- const GValue *provided_value;
+ /* Known property and we have a value to set */
+ DEBUG ("looking up %s... has=%d", room_property_signatures[id].name,
+ tp_properties_context_has (ctx, id));
+
+ if (!val_str)
+ {
+ const GValue *provided_value;
+
+ provided_value = tp_properties_context_get (ctx, id);
- provided_value = tp_properties_context_get (ctx, id);
+ switch (type) {
+ case G_TYPE_BOOLEAN:
+ val_bool = g_value_get_boolean (provided_value);
+ if (invert)
+ val_bool = !val_bool;
+ val_str = val_bool ? "1" : "0";
+ break;
+ case G_TYPE_STRING:
+ val_str = g_value_get_string (provided_value);
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+ }
+
+ DEBUG ("Setting value %s for %s", val_str, var);
- switch (type) {
- case G_TYPE_BOOLEAN:
- val_bool = g_value_get_boolean (provided_value);
- sprintf (buf, "%d", (invert) ? !val_bool : val_bool);
- val_str = buf;
- break;
- case G_TYPE_STRING:
- val_str = g_value_get_string (provided_value);
- break;
- default:
- g_assert_not_reached ();
- }
+ props_left &= ~(1 << id);
+
+ /* add the corresponding value node(s) to the reply message */
+ lm_message_node_add_child (field_node, "value", val_str);
}
+ else
+ {
+ /* Copy all the <value> nodes */
+ LmMessageNode *value_node;
- DEBUG ("Setting value %s for %s", val_str, var);
- lm_message_node_set_value (value_node, val_str);
+ for (value_node = node->children; value_node != NULL;
+ value_node = value_node->next)
+ {
+ if (tp_strdiff (value_node->name, "value"))
+ /* Not a value, skip it */
+ continue;
- props_left &= ~(1 << id);
+ lm_message_node_add_child (field_node, "value",
+ lm_message_node_get_value (value_node));
+ }
+ }
}
if (props_left != 0)
gabble-pep-notifications.patch:
--- NEW FILE gabble-pep-notifications.patch ---
diff -rN -u old-telepathy-gabble-openfire/src/conn-olpc.c new-telepathy-gabble-openfire/src/conn-olpc.c
--- old-telepathy-gabble-openfire/src/conn-olpc.c 2007-11-30 14:41:25.000000000 +0100
+++ new-telepathy-gabble-openfire/src/conn-olpc.c 2007-11-30 14:41:25.000000000 +0100
@@ -534,6 +534,11 @@
{
GHashTable *properties;
LmMessageNode *node;
+ TpBaseConnection *base = (TpBaseConnection*) conn;
+
+ if (handle == base->self_handle)
+ /* Ignore echoed pubsub notifications */
+ return TRUE;
node = lm_message_node_find_child (msg->node, "properties");
properties = lm_message_node_extract_properties (node, "property");
@@ -1086,6 +1091,11 @@
TpHandle handle)
{
GPtrArray *activities;
+ TpBaseConnection *base = (TpBaseConnection*) conn;
+
+ if (handle == base->self_handle)
+ /* Ignore echoed pubsub notifications */
+ return TRUE;
extract_activities (conn, msg, handle);
activities = get_buddy_activities (conn, handle);
@@ -1354,6 +1364,11 @@
{
guint room_handle;
const gchar *activity;
+ TpBaseConnection *base = (TpBaseConnection*) conn;
+
+ if (handle == base->self_handle)
+ /* Ignore echoed pubsub notifications */
+ return TRUE;
if (extract_current_activity (conn, msg, &activity, &room_handle))
{
@@ -1867,6 +1882,12 @@
LmMessage *msg,
TpHandle handle)
{
+ TpBaseConnection *base = (TpBaseConnection*) conn;
+
+ if (handle == base->self_handle)
+ /* Ignore echoed pubsub notifications */
+ return TRUE;
+
return update_activities_properties (conn, msg);
}
Index: telepathy-gabble.spec
===================================================================
RCS file: /cvs/pkgs/rpms/telepathy-gabble/OLPC-2/telepathy-gabble.spec,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- telepathy-gabble.spec 20 Nov 2007 17:34:18 -0000 1.48
+++ telepathy-gabble.spec 5 Dec 2007 17:16:28 -0000 1.49
@@ -11,6 +11,8 @@
URL: http://telepathy.freedesktop.org/wiki/
Source0: http://telepathy.freedesktop.org/releases/%{name}/%{name}-%{version}.tar.gz
Patch0: gabble-olpc-no-dbus-uid-check.patch
+Patch1: gabble-pep-notifications.patch
+Patch2: gabble-muc-properties.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -35,6 +37,8 @@
# -n %{name}-%{version}-%{alphatag}
#%patch0 -p1 -b .no-Werror
%patch0 -p1 -b .dbus-uid
+%patch1 -p1 -b .pep
+%patch2 -p1 -b .muc-props
%build
%configure
@@ -60,6 +64,12 @@
%changelog
+* Wed Dec 05 2007 Dafydd Harries <dafydd.harries at collabora.co.uk> - 0.7.1-0.4.olpc3
+- dev.laptop.org #5223: Add patch from upstream so that echoed PEP
+ notifications are ignored.
+- dev.laptop.org #5224: Add patch from upstream for improved handling og MUC
+ properties.
+
* Thu Nov 15 2007 Robert McQueen <robert.mcqueen at collabora.co.uk> - 0.7.1-0.4.olpc2
- dev.laptop.org #4948: Add OLPC-specific patch to disable checking of the
UID connecting to D-Bus tubes.
More information about the fedora-extras-commits
mailing list