static void presence_changed(GtkComboBox *combo_box, gpointer data)
{
- XMPPPresence *pres;
- XMPPConnection *connection = data;
+ JubChatClient *client = data;
OFAutoreleasePool *pool = [OFAutoreleasePool new];
-
const char *status = gtk_combo_box_get_active_id(combo_box);
- if (!strcmp(status, "unavailable"))
- pres = [XMPPPresence presenceWithType: @"unavailable"];
- else {
- pres = [XMPPPresence presence];
- if (strcmp(status, "available"))
- [pres setShow: @(status)];
- }
-
- [connection sendStanza: pres];
+ [client sendPresenceWithStatus: @(status)];
[pool release];
}
_presence_combo_changed_handler_id =
g_signal_connect(_presence_combo, "changed",
- G_CALLBACK(presence_changed), client.connection);
+ G_CALLBACK(presence_changed), client);
g_object_unref(G_OBJECT(builder));
} @catch (id e) {