diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-01-04 13:09:40 +0100 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-01-08 11:43:25 +0000 |
commit | ae4be50782e52dcdea3a6e40e04ef4a43713f8a7 (patch) | |
tree | e48f846f85d89c7894dab174b58059c6435cf70f /src/muc-channel.c | |
parent | 526208c2475dc1eaccddc96238f10a2073e6720e (diff) | |
download | telepathy-gabble-ae4be50782e52dcdea3a6e40e04ef4a43713f8a7.tar.gz |
Handle the fill-presence signal
Diffstat (limited to 'src/muc-channel.c')
-rw-r--r-- | src/muc-channel.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/muc-channel.c b/src/muc-channel.c index fbb654173..91cea8ecd 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -275,6 +275,10 @@ static TpHandle create_room_identity (GabbleMucChannel *) /* signatures for presence handlers */ +static void handle_fill_presence (WockyMuc *muc, + WockyXmppStanza *stanza, + gpointer user_data); + static void handle_renamed (GObject *source, WockyXmppStanza *stanza, GHashTable *code, @@ -416,6 +420,9 @@ gabble_muc_channel_constructor (GType type, guint n_props, g_signal_connect (wmuc, "left", (GCallback) handle_left, self); g_signal_connect (wmuc, "error", (GCallback) handle_error, self); + g_signal_connect (wmuc, "fill-presence", G_CALLBACK (handle_fill_presence), + self); + /* message handler(s) (just one needed so far) */ g_signal_connect (wmuc, "message", (GCallback) handle_message, self); g_signal_connect (wmuc, "message-error",(GCallback) handle_errmsg, self); @@ -2134,6 +2141,19 @@ handle_perms (GObject *source, handle_tube_presence (gmuc, myself, stanza); } +static void +handle_fill_presence (WockyMuc *muc, + WockyXmppStanza *stanza, + gpointer user_data) +{ + GabbleMucChannel *self = GABBLE_MUC_CHANNEL (user_data); + GabbleMucChannelPrivate *priv = GABBLE_MUC_CHANNEL_GET_PRIVATE (self); + + gabble_presence_add_status_and_vcard (priv->conn->self_presence, stanza); + + g_signal_emit (self, signals[PRE_PRESENCE], 0, (LmMessage *) stanza); +} + /* connect to wocky-muc:SIG_NICK_CHANGE, which we will receive when the * * MUC informs us our nick has been changed for some reason */ static void @@ -3621,9 +3641,6 @@ gabble_muc_channel_send_presence (GabbleMucChannel *self, stanza = wocky_muc_create_presence (priv->wmuc, WOCKY_STANZA_SUB_TYPE_NONE, NULL, NULL); - gabble_presence_add_status_and_vcard (priv->conn->self_presence, stanza); - - g_signal_emit (self, signals[PRE_PRESENCE], 0, (LmMessage *) stanza); result = _gabble_connection_send (priv->conn, (LmMessage *) stanza, error); g_object_unref (stanza); |