Approve room invitations
We use to rely on Empathy for this but as we plan to allow users to be connected on IM without having Empathy running the Shell should do it now. https://bugzilla.gnome.org/show_bug.cgi?id=653740
This commit is contained in:
@ -101,6 +101,15 @@ shell_tp_client_init (ShellTpClient *self)
|
||||
/* Approver */
|
||||
tp_base_client_add_approver_filter (TP_BASE_CLIENT (self), filter);
|
||||
|
||||
/* Approve room invitations. We don't handle or observe room channels so
|
||||
* just register this filter for the approver. */
|
||||
tp_base_client_take_approver_filter (TP_BASE_CLIENT (self), tp_asv_new (
|
||||
TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
|
||||
TP_IFACE_CHANNEL_TYPE_TEXT,
|
||||
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
|
||||
TP_HANDLE_TYPE_ROOM,
|
||||
NULL));
|
||||
|
||||
/* Handler */
|
||||
tp_base_client_add_handler_filter (TP_BASE_CLIENT (self), filter);
|
||||
|
||||
@ -371,3 +380,15 @@ shell_get_contact_events (TplLogManager *log_manager,
|
||||
NULL, NULL,
|
||||
callback, NULL);
|
||||
}
|
||||
|
||||
/* gjs doesn't allow us to craft a GError so we need a C wrapper */
|
||||
void
|
||||
shell_decline_dispatch_op (TpAddDispatchOperationContext *context,
|
||||
const gchar *message)
|
||||
{
|
||||
GError *error = g_error_new_literal (TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
|
||||
message);
|
||||
|
||||
tp_add_dispatch_operation_context_fail (context, error);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
@ -111,5 +111,8 @@ void shell_get_contact_events (TplLogManager *log_manager,
|
||||
guint num_events,
|
||||
GAsyncReadyCallback callback);
|
||||
|
||||
void shell_decline_dispatch_op (TpAddDispatchOperationContext *context,
|
||||
const gchar *message);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __SHELL_TP_CLIENT_H__ */
|
||||
|
Reference in New Issue
Block a user