Bug 310946 - No notification sound when a new message comes in in an active chat window
Summary: No notification sound when a new message comes in in an active chat window
Status: RESOLVED FIXED
Alias: None
Product: telepathy
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 0.5.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: Future
Assignee: Telepathy Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-30 20:18 UTC by roman
Modified: 2012-11-30 22:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.5.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description roman 2012-11-30 20:18:03 UTC
I would like to get a notification sound even while the chat window is active because I'm not always watching my screen. 

In the setupdialog the sounds are working when I click the play button. All other notifications are working properly.

Reproducible: Always

Steps to Reproduce:
1. Set up a notification sound for incoming messages in active windows
2. activate the chat window an wait for an incoming message
3. nothing is going to happen
Actual Results:  
no notification sound was played

Expected Results:  
getting a notification sound :)
Comment 1 Martin Klapetek 2012-11-30 22:24:55 UTC
Thanks for the report!

That behavior is actually correct as it notifies only when the window does not have focus, otherwise you'd get the notification sound with absolutely every single message and I can imagine that being annoying after a while. Even facebook plays no sound when the chat is focused (though they do play a sound when the pause in the chat is longer than N).

In fact, you can probably try it on yourself with very simple patch (if you are using self-compiled install, otherwise it won't work):

Open ktp-text-ui/lib/chat-widget.cpp and change line 676, in the codeblock looking like this:

    if(isOnTop()) {
        kDebug() << "Widget is on top, not doing anything";
        return;
    }

and change it into

    if(isOnTop()) {
        kDebug() << "Widget is on top, not doing anything";
        //return;
    }


Recompile and install. And then try using it for a while. I'm pretty sure it will get annoying :)
Comment 2 David Edmundson 2012-11-30 22:29:14 UTC
Martin, that's not quite true. 

We have a separate notification for if it's the active chat (which by default does nothing). There's a FIXME in the code (just above the part you posted). I think that's the one the reporter is talking about.

It's not connected up in the code, there's a FIXME above the part you pasted. I see no reason why that's the case.
Will fix.
Comment 3 Martin Klapetek 2012-11-30 22:38:16 UTC
Hah, indeed there is! I just did a grep through the code. Let's fix it then!
Comment 4 David Edmundson 2012-11-30 22:54:57 UTC
Git commit 2aa32aa5db66c3a06d16001ce092c7906e68f844 by David Edmundson.
Committed on 30/11/2012 at 23:54.
Pushed by davidedmundson into branch 'kde-telepathy-0.5'.

Correctly emit notifications for messages recieved in an active chat
Fixed-In: 0.5.2

M  +6    -8    lib/chat-widget.cpp

http://commits.kde.org/telepathy-text-ui/2aa32aa5db66c3a06d16001ce092c7906e68f844
Comment 5 David Edmundson 2012-11-30 22:55:33 UTC
Git commit 3b5f8196497f09bc333338e1713fe32ba2d47ac1 by David Edmundson.
Committed on 30/11/2012 at 23:54.
Pushed by davidedmundson into branch 'master'.

Correctly emit notifications for messages recieved in an active chat
Fixed-In: 0.5.2

M  +6    -8    lib/chat-widget.cpp

http://commits.kde.org/telepathy-text-ui/3b5f8196497f09bc333338e1713fe32ba2d47ac1