[Telepathy-commits] [telepathy-gabble/master] remove needless assertions (including removing the ability to cause an assertion error by sending an old-style MUC invite with no body)
Robert McQueen
robert.mcqueen at collabora.co.uk
Tue Aug 19 10:54:05 PDT 2008
20080727011203-418b8-b1d6ec84a5a94eeaf9e56ee8abcffb46fd2a5d31.gz
---
src/muc-channel.c | 3 ---
src/muc-factory.c | 18 ++----------------
2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/src/muc-channel.c b/src/muc-channel.c
index fcfa5ee..77e3f9f 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -364,9 +364,6 @@ gabble_muc_channel_constructor (GType type, guint n_props,
/* invited: add ourself to local pending and the inviter to members */
TpIntSet *set_members, *set_pending;
- g_assert (priv->initiator != 0);
- g_assert (priv->invitation_message != NULL);
-
set_members = tp_intset_new ();
set_pending = tp_intset_new ();
diff --git a/src/muc-factory.c b/src/muc-factory.c
index 902b1f5..53fe6b7 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -341,28 +341,17 @@ new_muc_channel (GabbleMucFactory *fac,
g_assert (g_hash_table_lookup (priv->text_channels,
GINT_TO_POINTER (handle)) == NULL);
- if (invited)
- {
- g_assert (inviter != 0);
- g_assert (message != NULL);
- }
- else
- {
- g_assert (inviter == conn->self_handle);
- g_assert (message == NULL);
- }
-
object_path = g_strdup_printf ("%s/MucChannel%u",
conn->object_path, handle);
DEBUG ("creating new chan, object path %s", object_path);
chan = g_object_new (GABBLE_TYPE_MUC_CHANNEL,
- "connection", priv->conn,
+ "connection", priv->conn,
"object-path", object_path,
"handle", handle,
"invited", invited,
- "initiator-handle", inviter,
+ "initiator-handle", invited ? inviter : conn->self_handle,
"invitation-message", message,
NULL);
@@ -583,9 +572,6 @@ process_muc_invite (GabbleMucFactory *fac,
if (reason_node != NULL)
reason = lm_message_node_get_value (reason_node);
- if (reason == NULL)
- reason = "";
-
/* create the channel */
room = gabble_remove_resource (from);
do_invite (fac, room, inviter_handle, reason);
--
1.5.6.3
More information about the Telepathy-commits
mailing list