Adium

Ticket #9920 (new enhancement)

Opened 8 months ago

Last modified 6 months ago

Timestamp on Growl notifications

Reported by: bigjoeystud Assigned to: nobody
Priority: normal Milestone: Adium 1.4
Component: Adium UI Version: 1.2.5
Severity: normal Keywords:
Cc: Patch: Needs Dev Review
Pending: 0

Description

Would it be possible to have time stamps on each of the growl notifications? I'd be in interested in knowing when people log in/off.

Attachments

GrowlTimeStamp.png (18.1 kB) - added by stuartc on 06/28/2008 11:37:48 AM.
Growl notifications with time stamps
GrowlAlertNib.tar.bz2 (3.8 kB) - added by stuartc on 06/28/2008 06:15:14 PM.
GrowlAlert.nib with new option to show time stamp
GrowlWithTimeStamps.diff (6.7 kB) - added by stuartc on 06/29/2008 09:49:47 AM.
Growl notifications with option of showing time stamps

Change History

05/27/2008 06:11:26 PM changed by jas8522

  • milestone set to Adium X 1.4.

Sounds reasonable - and especially useful for those using sticky notifications.

06/26/2008 04:15:30 PM changed by stuartc

I'm new to Adium development but I'm currently working on implementing this.

06/26/2008 04:19:22 PM changed by Robby

Cool! :)

06/28/2008 11:36:55 AM changed by stuartc

I've finished implementing this but I think I need some input on how the time stamp is to be displayed in the notification. The way that I have currently coded it, is to simply prefix the notification description with the time stamp surrounded by square brackets. For example:

<title>
[<time>] <description>

I can easily change it to be included in the title rather than the description but I really need some feedback on this. I'll attach a screenshot of some actual notifications with time stamps.

06/28/2008 11:37:48 AM changed by stuartc

  • attachment GrowlTimeStamp.png added.

Growl notifications with time stamps

06/28/2008 11:43:48 AM changed by boredzo

That looks fine to me. Hopefully, you're using the user's short time format (see NSDateFormatter).

06/28/2008 02:03:52 PM changed by stuartc

I wasn't but I am now. I've also added this as a new option when adding a Growl notification to a particular event, so along with having the option to make the notification 'Sticky' there is now also the option to 'Show time stamp'. I figured users may not want the time stamp on every different type of notification. Also, how do I got about getting the interface strings localized?

06/28/2008 02:07:47 PM changed by David Munch

Nice work stuartc! Looks fine to me, but would it be possible to put the time in the top-right corner instead? I believe this lower the focus that time has in your screenshot.

06/28/2008 04:16:50 PM changed by stuartc

David, unfortunately this is not possible as the Growl API currently does not allow the option to place specific text, it only allows two different lines, the notification title and description.

06/28/2008 06:15:14 PM changed by stuartc

  • attachment GrowlAlertNib.tar.bz2 added.

GrowlAlert.nib with new option to show time stamp

06/28/2008 06:31:24 PM changed by zacw

  • patch_status changed from None to Needs Dev Review.

One comment I have from just reading it over quickly: remember the case of RTL languages; [NSString stringWithFormat:AILocalizedString(@"[%@] %@", "A growl notification with a timestamp. The first %@ is the timestamp, the second is the description text"), timestamp, description); might be a better idea.

06/29/2008 08:14:58 AM changed by stuartc

You're absolutely right, I completely overlooked this requirement. I'll will update the patch with your suggestion included. Thanks.

06/29/2008 09:49:47 AM changed by stuartc

  • attachment GrowlWithTimeStamps.diff added.

Growl notifications with option of showing time stamps

06/29/2008 09:59:37 AM changed by zacw

Actually the above is mostly completely wrong. I, also, overlooked the fact that description is the message text when not including the subject. Just because a user's localization is RTL doesn't mean a message is. I'm not sure Growl even handles RTL text (at least, our implementation; we're passing around NSStrings, which lack the NSParagraphStyleAttributeName.

06/29/2008 10:00:19 AM changed by zacw

The above being my AILocalizedString() 'hack', not the patch.

06/29/2008 10:20:22 AM changed by stuartc

I see your point. The AILocalizedString() 'hack', simply changes the ordering of the time stamp and description. As you said this also does not taking into account whether or not the received message is in a RTL localization. Even if Growl did support RTL text then this would still be an issue, but only for messages sent from a contact and possibly for custom statuses. Am I right in thinking that all other notification text is effectively generated by Adium.