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 635991 - Implement Sent signals for Telepathy.
Implement Sent signals for Telepathy.
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 635990 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-11-28 15:28 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2010-12-01 18:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement Sent signals for Telepathy. (4.32 KB, patch)
2010-11-28 15:28 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Implement Sent signals for Telepathy. (4.07 KB, patch)
2010-11-29 16:07 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
telepathyClient: Implement Sent signals. (4.10 KB, patch)
2010-11-29 19:15 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
telepathyClient: Implement Sent signals. (4.11 KB, patch)
2010-11-29 20:02 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
telepathyClient: Implement Sent signals. (6.27 KB, patch)
2010-11-29 21:25 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
telepathyClient: Implement Sent signals. (6.27 KB, patch)
2010-11-29 21:29 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
telepathyClient: Implement Sent signals. (6.59 KB, patch)
2010-11-30 18:18 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
telepathyClient: Implement Sent signals. (6.27 KB, patch)
2010-11-30 19:23 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2010-11-28 15:28:15 UTC
This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.
Comment 1 Jasper St. Pierre (not reading bugmail) 2010-11-28 15:28:17 UTC
Created attachment 175417 [details] [review]
Implement Sent signals for Telepathy.

This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.
Comment 2 Jasper St. Pierre (not reading bugmail) 2010-11-28 15:29:02 UTC
*** Bug 635990 has been marked as a duplicate of this bug. ***
Comment 3 Jasper St. Pierre (not reading bugmail) 2010-11-29 16:07:15 UTC
Created attachment 175478 [details] [review]
Implement Sent signals for Telepathy.

This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.
Comment 4 Jasper St. Pierre (not reading bugmail) 2010-11-29 16:23:19 UTC
Rebased to master after overview-layout merge.
Comment 5 Dan Winship 2010-11-29 17:27:54 UTC
Comment on attachment 175478 [details] [review]
Implement Sent signals for Telepathy.

>Subject: [PATCH] Implement Sent signals for Telepathy.

Make that:

    telepathyClient: Implement Sent signals

>+        this._sentMessages = [];

Needs a better name. "_sentMessages" implies that it includes *all* sent messages.

It might be simpler to just not bother with that, and create this._notification at construct time, rename _ensureNotification() to _ensureSourceInMessageTray() or something, and then have _messageSent() always appendMessage()

>+    _messageSent: function(channel, timestamp, type, text) {

It's worth adding a comment before this pointing out explicitly that this is called both for messages we send ourselves, and for messages sent from other clients.

>+            this._notification.appendMessage(text, timestamp, true);
>+            this.notify(this._notification);

I don't think we want to notify() in the Sent case.

>+    appendMessage: function(text, timestamp, sent) {

don't use a boolean. No one will remember which way means "true" and which means "false". Use an enum type, or just pass in the style name directly.
Comment 6 Jasper St. Pierre (not reading bugmail) 2010-11-29 19:15:14 UTC
Created attachment 175488 [details] [review]
telepathyClient: Implement Sent signals.

This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.
Comment 7 Jasper St. Pierre (not reading bugmail) 2010-11-29 20:02:36 UTC
Created attachment 175491 [details] [review]
telepathyClient: Implement Sent signals.

This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.
Comment 8 Jasper St. Pierre (not reading bugmail) 2010-11-29 21:25:45 UTC
Created attachment 175499 [details] [review]
telepathyClient: Implement Sent signals.

This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.
Comment 9 Jasper St. Pierre (not reading bugmail) 2010-11-29 21:29:05 UTC
Created attachment 175500 [details] [review]
telepathyClient: Implement Sent signals.

This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.



Sorry about the bug-spam people. I've been trying to wrangle git-bz
into working for me.
Comment 10 Dan Winship 2010-11-30 15:20:24 UTC
Comment on attachment 175500 [details] [review]
telepathyClient: Implement Sent signals.

>+// Not currently referenced by the search API, but
>+// this enumeration can be useful for provider
>+// implementations.
>+const NotificationDirection = {

I think you accidentally copied that comment from somewhere else?

>+    _messageSent: function(channel, timestamp, type, text) {

Still think this should get a comment

>+    appendMessage: function(text, timestamp, direction) {
>+        let styles = {};
>+        styles[NotificationDirection.SENT] = 'chat-sent';
>+        styles[NotificationDirection.RECEIVED] = 'chat-received';

You don't want to recompute this every time appendMessage() is called. You could either define it at the top level, or else just change the enum so that the value of NotificationDirection.SENT is 'chat-sent' rather than 0, etc.


I see what you mean about Source.notify... it's sort of a mess. Some classes redefine it, but no one ever calls .notify on a source of an unknown type, so it always ends up working out. We might want to fix it up somehow at some point, but it doesn't have to be part of this patch.
Comment 11 Jasper St. Pierre (not reading bugmail) 2010-11-30 18:18:15 UTC
Created attachment 175560 [details] [review]
telepathyClient: Implement Sent signals.

This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.
Comment 12 Jasper St. Pierre (not reading bugmail) 2010-11-30 19:23:24 UTC
Created attachment 175571 [details] [review]
telepathyClient: Implement Sent signals.

This will allow us to update our notifications when
someone uses a different Telepathy client to send
messages.
Comment 13 Dan Winship 2010-12-01 18:47:38 UTC
Attachment 175571 [details] pushed as b9eca84 - telepathyClient: Implement Sent signals.