Bug 175687 - [PATCH] kopete ignores custom notifications
Summary: [PATCH] kopete ignores custom notifications
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unmaintained
Component: Notifications (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
: 186679 189393 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-20 18:18 UTC by doc.evans
Modified: 2009-08-14 18:38 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Fix custom notifications not working (684 bytes, patch)
2009-03-10 00:22 UTC, Lamarque V. Souza
Details
Fix custom notifications when user changes state (816 bytes, patch)
2009-03-10 19:30 UTC, Lamarque V. Souza
Details

Note You need to log in before you can comment on or make changes to this bug.
Description doc.evans 2008-11-20 18:18:22 UTC
Version:            (using KDE 4.1.3)
Installed from:    Ubuntu Packages

If I associate a notification (say, play a sound) with an event (say, going online) for a particular contact, then kopete seems to ignore that association and instead performs the default notification (if any) for that event.

For example, if I set the default to play file A when contacts log in and the custom to play file B when contact Z logs in, then file A always seems to get played when a contact logs in, even if the contact is Z.
Comment 1 Lamarque V. Souza 2009-02-04 23:02:12 UTC
I can confirm this bug in Kopete from KDE 4.2.0. My system Portage 2.2_rc23 (default/linux/amd64/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.27.9-lvs x86_64)
Comment 2 Lamarque V. Souza 2009-03-06 21:11:16 UTC
Stills happens with Kopete-4.2.1.
Comment 3 Lamarque V. Souza 2009-03-09 22:09:40 UTC
Well, I have figured out the problem is that there is no code implementing the custom notifications in kopete-4.2.1/kopete/libkopete/private/kopeteviewmanager.cpp (KopeteViewManager::messageAppended). The code should feed the eventId variable with the custom notification id stored in ~/.kde4.2/share/config/kopete.notifyrc. When I have more time I am going to do that, anybody feel free to do it him/herself too :-)
Comment 4 Lamarque V. Souza 2009-03-09 22:33:47 UTC
Actually there is code to add contexts to notifications, this is how the custom notificatios is implemented. It is just not working :-/
Comment 5 Lamarque V. Souza 2009-03-09 22:40:23 UTC
I have found it. The code in kopeteviewmanager.cpp calls the context "metacontact" but they are written "contact" in ~/.kde4.2/share/config/kopete.notifyrc. I think the code that write to ~/.kde4.2/share/config/kopete.notifyrc must change "contact" to "metacontact" to make it consistent.
Comment 6 Lamarque V. Souza 2009-03-10 00:22:05 UTC
Created attachment 31962 [details]
Fix custom notifications not working

A patch says more than a thousand words hehe. I still think the best approach is using "metacontact" string everywhere, but for the hurried people this simple patch also solves the problem.
Comment 7 Christophe Marin 2009-03-10 17:46:47 UTC
*** Bug 186679 has been marked as a duplicate of this bug. ***
Comment 8 Lamarque V. Souza 2009-03-10 19:30:27 UTC
Created attachment 32006 [details]
Fix custom notifications when user changes state

One more place with the same problem.
Comment 9 Bram Schoenmakers 2009-04-14 20:35:58 UTC
*** Bug 189393 has been marked as a duplicate of this bug. ***
Comment 10 Benjamí Villoslada 2009-04-15 18:50:18 UTC
Same problem in Debian Sid:

$ kopete --version
Qt: 4.4.3
KDE: 4.2.2 (KDE 4.2.2)
Kopete: 0.70.2
Comment 11 Lamarque V. Souza 2009-04-15 20:53:58 UTC
Hi all, could someone from KDE apply those two patches I created? They solve this issue and someone can bring a better solution for Kopete in KDE 4.3.
Comment 12 Bram Schoenmakers 2009-04-16 09:15:50 UTC
Yes, I can confirm, the patch works.
Comment 13 Matt Rogers 2009-04-16 15:22:52 UTC
Bram: feel free to commit.
Comment 14 Bram Schoenmakers 2009-04-16 23:48:08 UTC
SVN commit 955078 by bram:

Custom notifications for contacts work again.

Patch by Lamarque Vieira Souza, thank you!

BUG:175687

 M  +1 -1      kopete/contactlist/kopetemetacontactlvi.cpp  
 M  +1 -1      libkopete/private/kopeteviewmanager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=955078
Comment 15 Bram Schoenmakers 2009-04-16 23:51:28 UTC
SVN commit 955080 by bram:

Fix in trunk for custom notifications.

The patches at bug 175687 apply for KDE 4.2.x, it seems much has changed
in the codebase to make them apply at all.
This is the only occurrence of the metacontact context I could find, so
I changed it.

CCBUG:175687

 M  +1 -1      kopeteviewmanager.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=955080
Comment 16 Benjamí Villoslada 2009-08-13 03:44:09 UTC
After KDE 4.3 update individual and group notifications doesn't work again --in Debian Sid.

Regards.
Comment 17 Lamarque V. Souza 2009-08-13 20:44:14 UTC
Actually it still works, but you have to delete your .kde and restart kopete, which is not a good option. I am trying to figure out what has changed in kopete (or knotify) configuration that caused that. One thing that I have noticed is that the eventId format used in ~/.kde/share/config/kopete.notifyrc has changed, but even deleting kopete.notifyrc and restarting kopete has not worked out.
Comment 18 Lamarque V. Souza 2009-08-13 23:29:13 UTC
Loging out, deleting /tmp/kde-lamarque/ksycoca, rebuilding sycoca with kbuildsycoca4 --noincremental, loging in again seems to have solved the problem. Well, KDE4 uses /var/tmp/kdecache-lamarque/ksycoca4 and not /tmp/kde-lamarque/ksycoca, maybe this is a old file from KDE3.
Comment 19 Benjamí Villoslada 2009-08-14 15:08:43 UTC
Lamarque, works fine moving ~/.kde/share/apps/kopete and ~/.kde/share/config/kopete* to /tmp

This delete all Kopete configurations.

Finally you can recover chat logs from /tmp/kopete/logs

Thanks!
Comment 20 Lamarque V. Souza 2009-08-14 18:38:13 UTC
I prefer to use kbuildsycoca4 --noincremental, this way I do not have to redo all my configurations.