From 525da01a62415ea63150dfdab53b809d9a0f7ec8 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 26 Feb 2011 12:32:27 -0500 Subject: [PATCH] shell-global: Add wrappers for TelepathyLogger gjs can't support more than one callback in the same function, so work around this with yet another shell-global wrapper. https://bugzilla.gnome.org/show_bug.cgi?id=643377 --- src/Makefile.am | 2 +- src/shell-global.c | 27 +++++++++++++++++++++++++++ src/shell-global.h | 7 +++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 7c251de0a..a018e81bd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -262,7 +262,7 @@ libgnome_shell_la_LIBADD = \ libgnome_shell_la_CPPFLAGS = $(gnome_shell_cflags) Shell-0.1.gir: libgnome-shell.la St-1.0.gir -Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-2.91 TelepathyGLib-0.12 +Shell_0_1_gir_INCLUDES = Clutter-1.0 ClutterX11-1.0 Meta-2.91 TelepathyGLib-0.12 TelepathyLogger-1.0 Shell_0_1_gir_CFLAGS = $(libgnome_shell_la_CPPFLAGS) -I $(srcdir) Shell_0_1_gir_LIBS = libgnome-shell.la Shell_0_1_gir_FILES = $(addprefix $(srcdir)/,$(libgnome_shell_la_gir_sources)) diff --git a/src/shell-global.c b/src/shell-global.c index 67c870325..88b8224b7 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -2088,3 +2088,30 @@ shell_get_self_contact_features (TpConnection *self, shell_global_get_self_contact_features_cb, callback, NULL, NULL); } + +/** + * shell_get_contact_events: + * @log_manager: A #TplLogManager + * @account: A #TpAccount + * @entity: A #TplEntity + * @num_events: The number of events to retrieve + * @callback: (scope async): User callback to run when the contact is ready + * + * Wrap tpl_log_manager_get_filtered_events_async because gjs cannot support + * multiple callbacks in the same function call. + */ +void +shell_get_contact_events (TplLogManager *log_manager, + TpAccount *account, + TplEntity *entity, + guint num_events, + GAsyncReadyCallback callback) +{ + tpl_log_manager_get_filtered_events_async (log_manager, + account, + entity, + TPL_EVENT_MASK_TEXT, + num_events, + NULL, NULL, + callback, NULL); +} diff --git a/src/shell-global.h b/src/shell-global.h index b3f86e398..1ca247c50 100644 --- a/src/shell-global.h +++ b/src/shell-global.h @@ -8,6 +8,7 @@ #include #include #include +#include G_BEGIN_DECLS @@ -165,6 +166,12 @@ void shell_get_self_contact_features (TpConnection *self, const TpContactFeature *features, ShellGetSelfContactFeaturesCb callback); +void shell_get_contact_events (TplLogManager *log_manager, + TpAccount *account, + TplEntity *entity, + guint num_events, + GAsyncReadyCallback callback); + G_END_DECLS #endif /* __SHELL_GLOBAL_H__ */