After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 643377 - telepathyClient: Integrate with TelepathyLogger
telepathyClient: Integrate with TelepathyLogger
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Dan Winship
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-26 19:30 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2011-03-14 22:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch 1/3. (3.10 KB, patch)
2011-02-26 19:30 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
Patch 2/3. (3.95 KB, patch)
2011-02-26 19:31 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
Patch 3/3. (6.69 KB, patch)
2011-02-26 19:31 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Require a recent TelepathyLogger (3.14 KB, patch)
2011-02-28 22:48 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
shell-global: Add wrappers for TelepathyLogger (3.29 KB, patch)
2011-02-28 22:48 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
telepathyClient: Add support for TelepathyLogger (6.91 KB, patch)
2011-02-28 22:48 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
Require a recent TelepathyLogger (3.61 KB, patch)
2011-03-03 20:31 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Require a recent TelepathyLogger (3.61 KB, patch)
2011-03-03 20:32 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
shell-global: Add wrappers for TelepathyLogger (3.51 KB, patch)
2011-03-03 20:33 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
telepathyClient: Add support for TelepathyLogger (7.04 KB, patch)
2011-03-03 20:33 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Require a recent TelepathyLogger (3.61 KB, patch)
2011-03-07 17:57 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
shell-global: Add wrappers for TelepathyLogger (3.51 KB, patch)
2011-03-07 17:58 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
telepathyClient: Add support for TelepathyLogger (7.04 KB, patch)
2011-03-07 17:59 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
telepathyClient: Add messages from TelepathyLogger (8.17 KB, patch)
2011-03-07 22:13 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
telepathyClient: Add messages from TelepathyLogger (8.61 KB, patch)
2011-03-08 00:04 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-02-26 19:30:30 UTC
Created attachment 182007 [details] [review]
Patch 1/3.

Requires patches from https://bugs.freedesktop.org/show_bug.cgi?id=34770 and https://bugzilla.gnome.org/show_bug.cgi?id=642793.
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-02-26 19:31:09 UTC
Created attachment 182008 [details] [review]
Patch 2/3.
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-02-26 19:31:29 UTC
Created attachment 182009 [details] [review]
Patch 3/3.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-02-27 13:39:52 UTC
"Requires 642793" is misphrased. None of the patches require changes from it, I was just lazy and didn't bother rebasing any of the patches, and I change stuff I introduced there.
Comment 4 Giovanni Campagna 2011-02-28 21:59:39 UTC
Review of attachment 182008 [details] [review]:

shell-global.c should contain only methods of the ShellGlobal object. Static functions are better off in shell-util.c

::: src/shell-global.c
@@ +2111,3 @@
+ * @callback: (scope async): User callback to run when the contact is ready
+ * 
+ * Wrap tpl_log_manager_get_filtered_events_async because gdb cannot support

Maybe you meant: gjs

@@ +2118,3 @@
+                          TpContact *contact,
+                          guint num_events,
+                          ShellGetContactEventsCb callback)

1) A callback cannot be invoked from bindings without an user_data parameter (it needs libffi data structures), independent of scope.
2) Since it's just a wrapper for gjs, can you preserve the GAsyncReadyCallback signature, and invoke manager.get_filtered_events_finish from JS?
Comment 5 Giovanni Campagna 2011-02-28 22:00:37 UTC
Review of attachment 182007 [details] [review]:

Looks good, but I think it should be squashed into later patches.
Comment 6 Jasper St. Pierre (not reading bugmail) 2011-02-28 22:48:17 UTC
Created attachment 182142 [details] [review]
Require a recent TelepathyLogger

This is a phony commit for now, as telepathy-logger needs the patches
from https://bugs.freedesktop.org/show_bug.cgi?id=34770.

Additionally, update gnome-shell.modules to use the new git.freedesktop.org
repository URLs instead of the old ones at git.collabora.co.uk.
Comment 7 Jasper St. Pierre (not reading bugmail) 2011-02-28 22:48:23 UTC
Created attachment 182143 [details] [review]
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.
Comment 8 Jasper St. Pierre (not reading bugmail) 2011-02-28 22:48:29 UTC
Created attachment 182144 [details] [review]
telepathyClient: Add support for TelepathyLogger

Add a number of lines of chat history from TelepathyLogger
when a source is created.
Comment 9 Dan Winship 2011-03-03 17:49:09 UTC
Comment on attachment 182142 [details] [review]
Require a recent TelepathyLogger

>This is a phony commit for now, as telepathy-logger needs the patches
>from https://bugs.freedesktop.org/show_bug.cgi?id=34770.

The upstream bug is closed. Does that mean this is good to go? If so, feel free to commit it with an updated commit message.
Comment 10 Dan Winship 2011-03-03 17:53:25 UTC
Comment on attachment 182143 [details] [review]
shell-global: Add wrappers for TelepathyLogger

>+void
>+shell_get_contact_events (TplLogManager *log_manager,
>+                          TpAccount *account,
>+                          TpContact *contact,
>+                          guint num_events,
>+                          GAsyncReadyCallback callback)

as Giovanni already said, you need a user_data param

(He also said that utilities should go in shell-util rather than shell-global, which is true, but this should stay in shell-global for consistency with the other tp wrappers, and we should mass-move the non-ShellGlobal parts of shell-global over to shell-util at a later date.)

>+  TplEntity *entity = tpl_entity_new_from_tp_contact (contact, TPL_ENTITY_CONTACT);

It's preferable to make the wrappers as thin as possible; could this part be done in the JS instead?
Comment 11 Dan Winship 2011-03-03 18:04:41 UTC
Comment on attachment 182144 [details] [review]
telepathyClient: Add support for TelepathyLogger

>+    appendMessage: function(message, direction, timestampWanted) {

Couldn't you just omit the timestamp field in the log-replayed messages, and key off that?

>+        this._append(messageBody, styles, message.timestamp);
>     },
> 
>-    _append: function(text, styles, timestamp) {
>+    _append: function(text, styles, timestamp, timestampWanted) {

you're not passing timestampWanted from appendMessage to _append.
Comment 12 Jasper St. Pierre (not reading bugmail) 2011-03-03 20:31:35 UTC
Created attachment 182399 [details] [review]
Require a recent TelepathyLogger

We require a TelepathyLogger version with gobject-introspection support.

Additionally, update gnome-shell.modules to use the new git.freedesktop.org
repository URLs instead of the old ones at git.collabora.co.uk.
Comment 13 Jasper St. Pierre (not reading bugmail) 2011-03-03 20:32:21 UTC
Created attachment 182400 [details] [review]
Require a recent TelepathyLogger

We require a TelepathyLogger version with gobject-introspection support.

Additionally, update gnome-shell.modules to use the new git.freedesktop.org
repository URLs instead of the old ones at git.collabora.co.uk.



excuse the bugspam, trying to wrangle git-bz

bumped required version to 0.2.4, rewrote commit message, rebased
Comment 14 Jasper St. Pierre (not reading bugmail) 2011-03-03 20:33:06 UTC
Created attachment 182401 [details] [review]
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.



rebased, new gobject-introspection from gcampax, added user_data,
made wrapper more paper thin
Comment 15 Jasper St. Pierre (not reading bugmail) 2011-03-03 20:33:16 UTC
Created attachment 182402 [details] [review]
telepathyClient: Add support for TelepathyLogger

Add a number of lines of chat history from TelepathyLogger
when a source is created.
Comment 16 Jasper St. Pierre (not reading bugmail) 2011-03-07 17:57:59 UTC
Created attachment 182740 [details] [review]
Require a recent TelepathyLogger

We require a TelepathyLogger version with gobject-introspection support.

Additionally, update gnome-shell.modules to use the new git.freedesktop.org
repository URLs instead of the old ones at git.collabora.co.uk.
Comment 17 Jasper St. Pierre (not reading bugmail) 2011-03-07 17:58:06 UTC
Created attachment 182741 [details] [review]
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.
Comment 18 Jasper St. Pierre (not reading bugmail) 2011-03-07 17:59:53 UTC
Created attachment 182742 [details] [review]
telepathyClient: Add support for TelepathyLogger

Add a number of lines of chat history from TelepathyLogger
when a source is created.



There seems to be a bug where the first message from somebody
won't show up, so the notification will show the last history
item. I'm looking into it.
Comment 19 Jasper St. Pierre (not reading bugmail) 2011-03-07 22:13:17 UTC
Created attachment 182779 [details] [review]
telepathyClient: Add messages from TelepathyLogger

This allows users to see chat history from other contacts with
the inline message tray replies.
Comment 20 Jasper St. Pierre (not reading bugmail) 2011-03-08 00:04:03 UTC
Created attachment 182789 [details] [review]
telepathyClient: Add messages from TelepathyLogger

This allows users to see chat history from other contacts with
the inline message tray replies.



forgot to stage a change
Comment 21 Dan Winship 2011-03-14 18:32:46 UTC
Comment on attachment 182740 [details] [review]
Require a recent TelepathyLogger

this is ok to commit, but you'll need to update the commit message, since this part has already been committed:

>Additionally, update gnome-shell.modules to use the new git.freedesktop.org
>repository URLs instead of the old ones at git.collabora.co.uk.
Comment 22 Dan Winship 2011-03-14 18:34:32 UTC
Comment on attachment 182741 [details] [review]
shell-global: Add wrappers for TelepathyLogger

>+                                             callback, NULL);

If you keep the user_data param, you need to actually pass it there, so it gets passed to the callback. However, it turns out that gjs doesn't actually need a user_data anyway if scope is async. So, either drop the user_data again, or change the NULL to user_data here. Either way, ok to commit.
Comment 23 Dan Winship 2011-03-14 18:38:34 UTC
Comment on attachment 182789 [details] [review]
telepathyClient: Add messages from TelepathyLogger

>+     * @noTimestamp: Whether to add a timestamp

"if %true, no timestamp will be added, regardless of the difference since the last timestamp"

good to commit with that change
Comment 24 Jasper St. Pierre (not reading bugmail) 2011-03-14 22:53:53 UTC
Attachment 182740 [details] pushed as 12df10b - Require a recent TelepathyLogger
Attachment 182741 [details] pushed as 525da01 - shell-global: Add wrappers for TelepathyLogger
Attachment 182789 [details] pushed as 5a269db - telepathyClient: Add messages from TelepathyLogger