[sip-comm-dev] Proactive Notification


#1

Hello,

I'm working for the end of my GSoC on a proactive notification. It's
like the tone for a phone call but for instant messaging.

I've tested it with MSN and Jabber but we should test this
notification on other protocols.

Can someone test it ?

Bye

Damien

proactive-notification.patch (5.62 KB)


#2

Hi Damien,

I'm working for the end of my GSoC on a proactive notification. It's
like the tone for a phone call but for instant messaging.

I dont' understand the analogy. Could you explain please?

I've tested it with MSN and Jabber but we should test this
notification on other protocols.

Can someone test it ?

I tested with jabber (Gmail client, Gajim and Pidgin) and I do get the
"is typing a message to you" popup. Sometimes it flickers but I don't
know if it's related to your patch.

Cheers,

···

On Mon, Aug 25, 2008 at 3:17 PM, Damien Roth <damien.roth@gmail.com> wrote:

--
Sébastien Mazy


#3

Hi,

I'm working for the end of my GSoC on a proactive notification. It's
like the tone for a phone call but for instant messaging.

I dont' understand the analogy. Could you explain please?

This notification warns the user that one of his contacts is writing a message.
You're going to tell me that it's already implemented but the
difference is that the chat window isn't open and a conversation is
not necessarily going with the contact.

In a future patch, the notification will be completely rewritten using
the notification service. Thus, the user will be able to configure the
notification as he wishes (enable / disable, popup message / sound /
launch program). But I got some problems to create the notifications
during the first run of the app'.

For my tests I've hacked the service to create the notification but it
can't be used for production. Does someone know where the initial
defaults settings are stored for the notification service ?

I've tested it with MSN and Jabber but we should test this
notification on other protocols.

Can someone test it ?

I tested with jabber (Gmail client, Gajim and Pidgin) and I do get the
"is typing a message to you" popup. Sometimes it flickers but I don't
know if it's related to your patch.

What do you mean by "it flickers". The popup is shown several times in
a row ? But if it's from the popup itself, it may be from the library.

Cheers,
Damien

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi Damien,

This notification warns the user that one of his contacts is writing a message.
You're going to tell me that it's already implemented but the
difference is that the chat window isn't open and a conversation is
not necessarily going with the contact.

Thanks for the clarification. Then your patch works as expected on my side.

For my tests I've hacked the service to create the notification but it
can't be used for production. Does someone know where the initial
defaults settings are stored for the notification service ?

Have a look at:
net.java.sip.communicator.impl.notification.NotificationServiceImpl.saveNotification()
line 473

Here is the stack trace when this method is called and the
configuration file was empty:
     [java] at java.lang.Thread.dumpStack(Thread.java:1206)
     [java] at
net.java.sip.communicator.impl.notification.NotificationServiceImpl.saveNotification(NotificationServiceImpl.java:453)
     [java] at
net.java.sip.communicator.impl.notification.NotificationServiceImpl.registerDefaultNotificationForEvent(NotificationServiceImpl.java:1028)
     [java] at
net.java.sip.communicator.impl.gui.utils.NotificationManager.registerGuiNotifications(NotificationManager.java:37)
     [java] at
net.java.sip.communicator.impl.gui.GuiActivator.start(GuiActivator.java:73)
     [java] at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589)
     [java] at
org.apache.felix.framework.Felix._startBundle(Felix.java:1536)
     [java] at org.apache.felix.framework.Felix.startBundle(Felix.java:1470)
     [java] at
org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1065)
     [java] at
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:258)
     [java] at java.lang.Thread.run(Thread.java:619)

What do you mean by "it flickers". The popup is shown several times in
a row ? But if it's from the popup itself, it may be from the library.

A quick, visible refresh while displayed, a "flash".

Cheers,

···

On Thu, Aug 28, 2008 at 9:12 PM, Damien Roth <damien.roth@gmail.com> wrote:

--
Sébastien Mazy


#5

Here is the stack trace when this method is called and the
configuration file was empty:

and so it seems that what you want is in:

net.java.sip.communicator.impl.gui.utils.NotificationManager.registerGuiNotifications(NotificationManager.java:37)

(sorry for the double reply)

···

On Thu, Aug 28, 2008 at 10:11 PM, Sébastien Mazy <sebastien.mazy@insa-lyon.fr> wrote:

--
Sébastien Mazy


#6

Hi Sebastien,

Thanks for your help, this was the right class.
I've attached the latest version of the proactive notification using
the notification service.

I also started to write a documentation for this service.

Bye

Damien

proactive-notification.patch (3.75 KB)


#7

Hi Damien,

your implementation looks very good and as you're now a developer you can commit the patch yourself:)

I have just one note and it is that the "is writing a message" string is not internationalized.

I was also wondering if it won't be a good idea to move this functionality in a separate plugin in the future. Even if we don't move it in a separate plugin, I think that we should add the possibility to enable/disable the proactive notifications. What do you think?

Cheers,
Yana

Damien Roth wrote:

···

Hi Sebastien,

Thanks for your help, this was the right class.
I've attached the latest version of the proactive notification using
the notification service.

I also started to write a documentation for this service.

Bye

Damien

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#8

Hi Yana,

Yes it's the last point I need to improve.
In the latest version I use the notification service to manage the
notification. The user can configure it like any other notification.

I will commit the code when I internationalized the code.

Bye

Damien

···

2008/9/8 Yana Stamcheva <yana@sip-communicator.org>:

Hi Damien,

your implementation looks very good and as you're now a developer you can
commit the patch yourself:)

I have just one note and it is that the "is writing a message" string is not
internationalized.

I was also wondering if it won't be a good idea to move this functionality
in a separate plugin in the future. Even if we don't move it in a separate
plugin, I think that we should add the possibility to enable/disable the
proactive notifications. What do you think?

Cheers,
Yana

Damien Roth wrote:

Hi Sebastien,

Thanks for your help, this was the right class.
I've attached the latest version of the proactive notification using
the notification service.

I also started to write a documentation for this service.

Bye

Damien

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

--
Damien ROTH
Programmeur n.m : Celui qui résout un problème que vous n'aviez pas,
d'une façon que vous ne comprenez pas.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#9

Hi all,

I'm happy (it's my very first commit) to announce that the proactive
notification is now part of the program.

The proactive notification will be added on the next start of the
program. To disable it, just go the the configuration panel >
notifications tab. Select the proactive notification then click on the
"deactivate" button and finally on the apply button.

For information: I've added the English and French translation for the
information popup string.

Bye

Damien

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#10

Hey Damien,

Congratulations on your first commit!

This is so cool! I've been feeling like a mind-reading jedi all morning :slight_smile:

One quick feature request. Wouldn't it be nice to be able and open a
window when the user clicks on a notification tool tip? We do this for
incoming messages so you could get some code from there.

And a minor comment concerning code, :

-import net.java.sip.communicator.impl.gui.*;
+import net.java.sip.communicator.impl.gui.GuiActivator;
+import net.java.sip.communicator.impl.gui.UIServiceImpl;

Any specific reason you would replace the asterisk import here, or was
it just a slip?

Other than that, I was being curious (and this is not an objection) as
to why you decided to implement the feature as a part of the UI service
and not as a plugin? Was there any specific reason, or was it an
arbitrary choice?

Cheers
Emil

Damien Roth написа:

···

Hi all,

I'm happy (it's my very first commit) to announce that the proactive
notification is now part of the program.

The proactive notification will be added on the next start of the
program. To disable it, just go the the configuration panel >
notifications tab. Select the proactive notification then click on the
"deactivate" button and finally on the apply button.

For information: I've added the English and French translation for the
information popup string.

Bye

Damien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#11

Hi Emil,

Hey Damien,

Congratulations on your first commit!

This is so cool! I've been feeling like a mind-reading jedi all morning :slight_smile:

One quick feature request. Wouldn't it be nice to be able and open a
window when the user clicks on a notification tool tip? We do this for
incoming messages so you could get some code from there.

It would be very nice, I will check this.

And a minor comment concerning code, :

-import net.java.sip.communicator.impl.gui.*;
+import net.java.sip.communicator.impl.gui.GuiActivator;
+import net.java.sip.communicator.impl.gui.UIServiceImpl;

Any specific reason you would replace the asterisk import here, or was
it just a slip?

Just a slip, I will correct it soon.

Other than that, I was being curious (and this is not an objection) as
to why you decided to implement the feature as a part of the UI service
and not as a plugin? Was there any specific reason, or was it an
arbitrary choice?

Well, at first I should say its arbitrary but when you think about it,
it may be the best choice.
It avoid writing a lot of lines (declaring new classes, a new bundle,
etc.). It may also had an influence on the memory ...

Cheers,
Damien

···

2008/9/14 Emil Ivov <emcho@sip-communicator.org>:

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#12

Hey Damien,

I've been using the feature for a while and I love it!

There's only a minor glitch that makes it a bit annoying. A user would
often send multiple typing notifications before actually sending a
message. As a result my systray popup queue gets regularly filled with
"Xyz is writing a message ..." messages which continue arriving long
after i've received and read the message.

We should probably think of a way to limit these to something like 1 per
minute per user. In other words - only popup a typing notification in
the systray if no notification has been shown for that user during the
last minute.

The easiest way to implement this would be to store in a Map the name
you show in the popup and the last system time you notified about their
typing status. You can update the map every time you show a new
notification.

Every time you query the map you could also make sure you remove all
those that have a system time which older than a minute. This would help
avoid a separate thread dedicated to map clean up.

How does this sound?

Emil
Damien Roth написа:

···

Hi Emil,

2008/9/14 Emil Ivov <emcho@sip-communicator.org>:

Hey Damien,

Congratulations on your first commit!

This is so cool! I've been feeling like a mind-reading jedi all morning :slight_smile:

One quick feature request. Wouldn't it be nice to be able and open a
window when the user clicks on a notification tool tip? We do this for
incoming messages so you could get some code from there.

It would be very nice, I will check this.

And a minor comment concerning code, :

-import net.java.sip.communicator.impl.gui.*;
+import net.java.sip.communicator.impl.gui.GuiActivator;
+import net.java.sip.communicator.impl.gui.UIServiceImpl;

Any specific reason you would replace the asterisk import here, or was
it just a slip?

Just a slip, I will correct it soon.

Other than that, I was being curious (and this is not an objection) as
to why you decided to implement the feature as a part of the UI service
and not as a plugin? Was there any specific reason, or was it an
arbitrary choice?

Well, at first I should say its arbitrary but when you think about it,
it may be the best choice.
It avoid writing a lot of lines (declaring new classes, a new bundle,
etc.). It may also had an influence on the memory ...

Cheers,
Damien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#13

Hi Emil,

While I'm writing this email the notification is being commited to the trunk.

As you said, there is a message surplus, so I implemented your idea
with a little modification.
I update the timer every time we got a (proactive)notification from
the contact. It's more accurate.

Bye
Damien

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#14

Hey Damien,

Hi Emil,

While I'm writing this email the notification is being commited to the trunk.

Excellent, looking forward to testing it.

As you said, there is a message surplus, so I implemented your idea
with a little modification.
I update the timer every time we got a (proactive)notification from
the contact. It's more accurate.

That's cool, and it's actually what I had in mind:

···

On Tue, Oct 14, 2008 at 10:38 PM, Damien Roth <damien.roth@gmail.com> wrote:

On Sat, Sep 27, 2008 at 12:14 PM, Emil Ivov <emcho@sip-communicator.org> wrote:

We should probably think of a way to limit these to something like 1 per
minute per user. In other words - only popup a typing notification in
the systray if no notification has been shown for that user during the
last minute.

I should probably stop using "user" and "contact" as synonyms as this
is not the first time this is leading to confusion.

Apologies.
Emil


#15

Hey Damien,

I kept having frequent notifications so I had a look at the code and it
seems that you were comparing the time of the last notification + 60s to
currentTimeMillis + 60s. In other words you considered the record stale
every time it was older than currentTimeMillis, or in other words always.

A couple of extra comments:

* You were removing the stale entries using the Map.remove() method
which is risky in the middle of an iterator loop. You are supposed to
use iterator.remove() in such cases.

* Your code was using tabs for indentation.

All fixed now.

Cheers
Emil

Damien Roth написа:

···

Hi Emil,

While I'm writing this email the notification is being commited to the trunk.

As you said, there is a message surplus, so I implemented your idea
with a little modification.
I update the timer every time we got a (proactive)notification from
the contact. It's more accurate.

Bye
Damien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net