Bug 163302 - message in popup notification is empty when receiving a message with only a smiley
Summary: message in popup notification is empty when receiving a message with only a s...
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Dennis Nienhüser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-05 21:13 UTC by Frederik Himpe
Modified: 2008-07-11 00:54 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot illustrating the problem (288.89 KB, image/png)
2008-06-07 18:49 UTC, Frederik Himpe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Himpe 2008-06-05 21:13:57 UTC
Version:           0.50.80 (kde 4.0.81) (using Devel)
Installed from:    Compiled sources

When a contact sends me a message containing a single smiley, then the notification popup only shows me "". If it cannot show the graphical version of the smiley, it should at least show the text version.
Comment 1 Roman Jarosz 2008-06-05 23:50:26 UTC
I cannot reproduce this, if the image can't be loaded or isn't found then I see file icon. It looks like a bug in emoticons theme, which theme do you use and which symbols aren't shown?
Comment 2 Dennis Nienhüser 2008-06-07 18:12:48 UTC
I can't reproduce this either. My guess would be that the emoticon is not sent as text, but as an image. The preview then (correctly) does not display it, although an empty popup shouldn't be shown (see bug 160280).
Comment 3 Frederik Himpe 2008-06-07 18:28:08 UTC
Yes, it's a duplicate of #160280, as explained in my first message, it is not an empty popup, it is "" which is shown in the popup, while the message windows shows that a single emoticon is sent.

I'm using the default kde4 emoticon style (it's the only one available in my system). I doubt however the emoticon is sent as an image: the image shown is the one from the kde4 style, and is the standard ":p" emoticon. I guess that if it was sent as an image, it would have been shown as an emoticon not available in the kde4 emoticon theme (the contact is not using kopete but standard msn) Maybe also relevant is the fact that I have disabled the option "Download and display custom emoticons".

Apparently I don't have the rights to mark this bug as a duplicate :-)
Comment 4 Dennis Nienhüser 2008-06-07 18:40:34 UTC
Emoticons are shown in the popup message preview. Therefore a single textual emoticon message shows up as "<img>" (<img> being an emoticon), while a single picture message shows up as "". If the message sent is :p like you describe, the emoticon should be displayed and this is not a duplicate of 160280.
Comment 5 Frederik Himpe 2008-06-07 18:49:56 UTC
Created attachment 25191 [details]
Screenshot illustrating the problem

Notice the two messages I received at the end. The second one is showing
Kopete's :p emoticon, while the pop-up just says "". Remind that I have
downloading of custom emoticons disabled in my MSN account settings.
Comment 6 Dennis Nienhüser 2008-06-07 19:55:57 UTC
Works fine here with exactly that emoticon. Can you please double-check that you're running kopete 0.50.80 or later? Does switching the emoticon theme (you can download additional themes using the emoticon manager in system settings => appereance) change anything?
Comment 7 Frederik Himpe 2008-06-14 17:07:54 UTC
The problem still happens with:
Version 0.50.80
Using KDE 4.00.82 (KDE 4.0.82 >= 20080610)

When clicking on Get New Themes in the emoticon mananager, Kopete crashes.

I tried installing Adiumicons theme from http://www.kde-look.org/content/show.php/Adiumicons+-+Kopete+Emoticon+Theme?content=61642

I downloaded the tarball, and chose install new theme in the emoticon manager, and pointed to the tarball. The theme was added to the list, however the preview in the emoticon manager is empty for this theme.

When I select the adiumicons theme, and send :p, I see in both the notification pop-up and in the message window the text :p. When I send :p with the standard kde4 icon theme, I get " " in the pop-up notification, and I get the right image in the message window.
Comment 8 Frederik Himpe 2008-06-22 12:24:02 UTC
I succeeded in correctly installing the kadu emoticon theme using khotnewstuff. The problem is exactly the same: a message containing ":p" is shown as " " in the notification popup, while in the chat window the right kadu emoticon is shown. 
About Kopete says:
Kopete
Version 0.50.80
Using KDE 4.00.83 (KDE 4.0.83 (KDE 4.1 Beta2)
Comment 9 Dennis Nienhüser 2008-06-22 12:40:42 UTC
Which protocol(s) are you using?
Comment 10 Frederik Himpe 2008-06-22 13:04:03 UTC
It happens both on MSN and Jabber/XMPP. For MSN I have it set not to download and export to other users the emoticons.
Comment 11 Nadine van der Heijden 2008-07-07 19:31:24 UTC
In KDE 3 & KDE 4 Kopete 0.50.1 is works with ":p" 
so to me it seems to be working
Comment 12 Nicolas L. 2008-07-07 19:46:50 UTC
i just tried, and on kde4 it works well
Comment 13 Frederik Himpe 2008-07-08 19:30:21 UTC
I just tried it with a fresh profile, and found out what triggers this bug: you have to enable the plug-in "Preview of pictures in chats". If this plug-in is disabled (which is the case by default), it works fine.
Comment 14 Dennis Nienhüser 2008-07-08 20:42:16 UTC
Ok, probably a conversion to html by that plugin, I'll look into it.
Comment 15 Dennis Nienhüser 2008-07-08 22:04:59 UTC
The image preview plugin does turn the message into html, which is then stripped by the message popup. This will happen generally if any plugin transforms the message into html.

Below is a workaround for the picture preview plugin which I'll commit once trunk is open again.

--- a/kopete/plugins/urlpicpreview/urlpicpreviewplugin.cpp
+++ b/kopete/plugins/urlpicpreview/urlpicpreviewplugin.cpp
@@ -79,8 +79,14 @@ void URLPicPreviewPlugin::aboutToDisplay ( Kopete::Message& message )
        {
                // reread configuration
                URLPicPreviewConfig::self()->readConfig();
-               // prepare parsed message body
-               message.setHtmlBody ( prepareBody ( message.parsedBody() ) );
+
+               QRegExp ex ( "(<a href=\")([^\"]*)(\" )?([^<]*)(</a>)(.*)$" );
+               QString myParsedBody = message.parsedBody();
+               if ( ex.indexIn ( myParsedBody ) != -1 )
+               {
+                       // Only change message if it contains urls
+                       message.setHtmlBody ( prepareBody ( myParsedBody ) );
+               }
        }
 }
Comment 16 Dennis Nienhüser 2008-07-10 19:35:39 UTC
SVN commit 830522 by nienhueser:

Leave messages untouched if they contain no urls.
CCBUG: 163302


 M  +8 -2      urlpicpreviewplugin.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=830522
Comment 17 Dennis Nienhüser 2008-07-11 00:54:40 UTC
SVN commit 830679 by nienhueser:

Leave messages untouched if they contain no urls. Backport of commit 830522.
BUG: 163302



 M  +8 -2      urlpicpreviewplugin.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=830679