diff options
author | <ole.andre.ravnaas@collabora.co.uk> | 2006-06-14 17:44:39 +0000 |
---|---|---|
committer | <ole.andre.ravnaas@collabora.co.uk> | 2006-06-14 17:44:39 +0000 |
commit | 095c7d0038f86ed8282cb6d1db6826572a61b0d7 (patch) | |
tree | bbc87f674cdab1c1c7b4c5e86f825b0db61aa99d | |
parent | a25d0ce15427250125d8a06ab18e8bce2f246e01 (diff) |
MUCFactory: return QUEUED in request function when a request is already in progress, and DONE if it's ready.
-rw-r--r-- | src/gabble-muc-channel.c | 12 | ||||
-rw-r--r-- | src/gabble-muc-channel.h | 1 | ||||
-rw-r--r-- | src/muc-factory.c | 11 |
3 files changed, 22 insertions, 2 deletions
diff --git a/src/gabble-muc-channel.c b/src/gabble-muc-channel.c index edaa5e2ef..3b36ab8c5 100644 --- a/src/gabble-muc-channel.c +++ b/src/gabble-muc-channel.c @@ -1046,6 +1046,18 @@ close_channel (GabbleMucChannel *chan, const gchar *reason, g_signal_emit (chan, signals[CLOSED], 0); } +gboolean +_gabble_muc_channel_is_ready (GabbleMucChannel *chan) +{ + GabbleMucChannelPrivate *priv; + + g_assert (GABBLE_IS_MUC_CHANNEL (chan)); + + priv = GABBLE_MUC_CHANNEL_GET_PRIVATE (chan); + + return priv->ready_emitted; +} + /** * _gabble_muc_channel_presence_error */ diff --git a/src/gabble-muc-channel.h b/src/gabble-muc-channel.h index fc98f79c3..a7953515d 100644 --- a/src/gabble-muc-channel.h +++ b/src/gabble-muc-channel.h @@ -66,6 +66,7 @@ GType gabble_muc_channel_get_type(void); #define GABBLE_MUC_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), GABBLE_TYPE_MUC_CHANNEL, GabbleMucChannelClass)) +gboolean _gabble_muc_channel_is_ready (GabbleMucChannel *chan); void _gabble_muc_channel_presence_error (GabbleMucChannel *chan, const gchar *jid, LmMessageNode *pres_node); void _gabble_muc_channel_member_presence_updated (GabbleMucChannel *chan, GabbleHandle handle, LmMessage *message, LmMessageNode *x_node); gboolean _gabble_muc_channel_receive (GabbleMucChannel *chan, TpChannelTextMessageType type, GabbleHandle sender, time_t timestamp, const gchar *text, LmMessage *msg); diff --git a/src/muc-factory.c b/src/muc-factory.c index 4a61946f3..ef17a4952 100644 --- a/src/muc-factory.c +++ b/src/muc-factory.c @@ -651,8 +651,15 @@ gabble_muc_factory_iface_request (TpChannelFactoryIface *iface, return TP_CHANNEL_FACTORY_REQUEST_STATUS_QUEUED; } - *ret = TP_CHANNEL_IFACE (chan); - return TP_CHANNEL_FACTORY_REQUEST_STATUS_DONE; + if (_gabble_muc_channel_is_ready (chan)) + { + *ret = TP_CHANNEL_IFACE (chan); + return TP_CHANNEL_FACTORY_REQUEST_STATUS_DONE; + } + else + { + return TP_CHANNEL_FACTORY_REQUEST_STATUS_QUEUED; + } } static void |