<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>87190</bug_id>
          
          <creation_ts>2004-08-14 13:22:29 +0000</creation_ts>
          <short_desc>Kopete parse error on URLs</short_desc>
          <delta_ts>2004-09-26 16:03:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kopete</product>
          <component>Yahoo Plugin</component>
          <version>unspecified</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Jes Hall">jes</reporter>
          <assigned_to name="Kopete Developers">kopete-bugs-null</assigned_to>
          <cc>illissius</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>258736</commentid>
    <comment_count>0</comment_count>
    <who name="Jes Hall">jes</who>
    <bug_when>2004-08-14 13:22:29 +0000</bug_when>
    <thetext>Version:           0.8.4 (using KDE 3.2.3, compiled sources)
Compiler:          gcc version 3.3.3
OS:                Linux (i686) release 2.4.26

When I&apos;m sent a url from a friend using Gaim Win32 on windows 2000, on the yahoo protocol, I get 
&quot;An internal Kopete error occurred while parsing a message:
XML document could not be parsed!&quot;

This occurs using any of the stylesheets included with Kopete.

The same person is able to send me url&apos;s without a problem from AIM or ICQ.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>258796</commentid>
    <comment_count>1</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-14 17:34:44 +0000</bug_when>
    <thetext>do you have debug output?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>258884</commentid>
    <comment_count>2</comment_count>
    <who name="Jes Hall">jes</who>
    <bug_when>2004-08-15 02:39:01 +0000</bug_when>
    <thetext>I don&apos;t, I don&apos;t know how to. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>258885</commentid>
    <comment_count>3</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-15 02:41:05 +0000</bug_when>
    <thetext>ok, no worries. Can you give me the url the person was trying to send you?

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>258886</commentid>
    <comment_count>4</comment_count>
    <who name="Jes Hall">jes</who>
    <bug_when>2004-08-15 02:43:10 +0000</bug_when>
    <thetext>of course. It was a number of URLs, but this was one of them

http://www.lowendmac.com/pb2/2300.shtml</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260310</commentid>
    <comment_count>5</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-20 06:27:44 +0000</bug_when>
    <thetext>CVS commit by mattr: 

Rearrange the message parsing a bit so we do it all before we create the
KopeteMessage object for it. 

Workaround gaim&apos;s bugginess when sending URLs so that there aren&apos;t parse
errors.

CCMAIL: 87190@bugs.kde.org


  M +55 -46    yahooaccount.cpp   1.94


--- kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp  #1.93:1.94
@@ -121,4 +121,8 @@ QString YahooAccount::stripMsgColorCodes
         filteredMsg.replace( QRegExp(&quot;\033\\[1m&quot;), &quot;&lt;b&gt;&quot; );
         filteredMsg.replace( QRegExp(&quot;\033\\[x1m&quot;), &quot;&lt;/b&gt;&quot; );
+    //work around gaim&apos;s broken sending
+    filteredMsg.remove( QRegExp( &quot;\033\\[xlm&quot; ) );
+    filteredMsg.remove( QRegExp( &quot;\033\\[lm&quot; ) );
+    //end work around
         filteredMsg.replace( QRegExp(&quot;\033\\[3m&quot;), &quot;&lt;i&gt;&quot; );
         filteredMsg.replace( QRegExp(&quot;\033\\[x3m&quot;), &quot;&lt;/i&gt;&quot; );
@@ -610,11 +614,8 @@ void YahooAccount::slotGotIm( const QStr
         }
 
-        KopeteMessageManager *mm = contact(who)-&gt;manager();
-
-        // Tell the message manager that the buddy is done typing
-        mm-&gt;receivedTypingMsg(contact(who), false);
-
-        justMe.append(myself());
-
+    //Parse the message for it&apos;s properties
+    kdDebug(14180) &lt;&lt; &quot;Original message is &apos;&quot; &lt;&lt; msg &lt;&lt; &quot;&apos;&quot; &lt;&lt; endl;
+    //kdDebug(14180) &lt;&lt; &quot;Message color is &quot; &lt;&lt; getMsgColor(msg) &lt;&lt; endl;
+    QColor fgColor = getMsgColor( msg );
         if (tm == 0)
                 msgDT.setTime_t(time(0L));
@@ -622,24 +623,32 @@ void YahooAccount::slotGotIm( const QStr
                 msgDT.setTime_t(tm, Qt::LocalTime);
 
-        KopeteMessage kmsg(msgDT, contact(who), justMe, msg,
-                                        KopeteMessage::Inbound , KopeteMessage::PlainText);
-
-        QString newMsg = stripMsgColorCodes(kmsg.plainBody());
+    QString newMsgText = stripMsgColorCodes( msg );
 
-        kmsg.setFg(getMsgColor(msg));
-//      kdDebug(14180) &lt;&lt; &quot;Message color is &quot; &lt;&lt; getMsgColor(msg) &lt;&lt; endl;
+    kdDebug(14180) &lt;&lt; &quot;Message after stripping color codes &apos;&quot; &lt;&lt; newMsgText &lt;&lt; &quot;&apos;&quot; &lt;&lt; endl;
 
-        if (newMsg.find(&quot;&lt;font&quot;) != -1)
+        if (newMsgText.find(&quot;&lt;font&quot;) != -1)
         {
-                msgFont.setFamily(newMsg.section(&apos;&quot;&apos;, 1,1));
+                msgFont.setFamily(newMsgText.section(&apos;&quot;&apos;, 1,1));
 
-                if (newMsg.find(&quot;size&quot;))
-                        msgFont.setPointSize(newMsg.section(&apos;&quot;&apos;, 3,3).toInt());
+                if (newMsgText.find(&quot;size&quot;))
+                        msgFont.setPointSize(newMsgText.section(&apos;&quot;&apos;, 3,3).toInt());
 
                 //remove the font encoding since we handle them ourselves
-                newMsg.remove(newMsg.mid(0, newMsg.find(&apos;&gt;&apos;)+1));
+                newMsgText.remove(newMsgText.mid(0, newMsgText.find(&apos;&gt;&apos;)+1));
         }
-        //set the new body that has correct HTML
-        kmsg.setBody(newMsg, KopeteMessage::RichText);
+
+    kdDebug(14180) &lt;&lt; &quot;Message after removing font tags &apos;&quot; &lt;&lt; newMsgText &lt;&lt; &quot;&apos;&quot; &lt;&lt; endl;
+
+        KopeteMessageManager *mm = contact(who)-&gt;manager();
+
+        // Tell the message manager that the buddy is done typing
+        mm-&gt;receivedTypingMsg(contact(who), false);
+
+        justMe.append(myself());
+
+        KopeteMessage kmsg(msgDT, contact(who), justMe, newMsgText,
+                                        KopeteMessage::Inbound , KopeteMessage::RichText);
+
+        kmsg.setFg( fgColor );
         kmsg.setFont(msgFont);
         mm-&gt;appendMessage(kmsg);


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260311</commentid>
    <comment_count>6</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-08-20 06:29:04 +0000</bug_when>
    <thetext>CVS commit by mattr: 

Backport of the fix for the parse errors when we&apos;ve been sent URLs in yahoo.

This should be in KDE 3.3.1

CCMAIL: 87190-done@bugs.kde.org


  M +29 -20    yahooaccount.cpp   1.93.2.1


--- kdenetwork/kopete/protocols/yahoo/yahooaccount.cpp  #1.93:1.93.2.1
@@ -121,4 +121,8 @@ QString YahooAccount::stripMsgColorCodes
         filteredMsg.replace( QRegExp(&quot;\033\\[1m&quot;), &quot;&lt;b&gt;&quot; );
         filteredMsg.replace( QRegExp(&quot;\033\\[x1m&quot;), &quot;&lt;/b&gt;&quot; );
+    //work around gaim&apos;s broken sending
+    filteredMsg.remove( QRegExp( &quot;\033\\[xlm&quot; ) );
+    filteredMsg.remove( QRegExp( &quot;\033\\[lm&quot; ) );
+    //end work around
         filteredMsg.replace( QRegExp(&quot;\033\\[3m&quot;), &quot;&lt;i&gt;&quot; );
         filteredMsg.replace( QRegExp(&quot;\033\\[x3m&quot;), &quot;&lt;/i&gt;&quot; );
@@ -610,11 +614,8 @@ void YahooAccount::slotGotIm( const QStr
         }
 
-        KopeteMessageManager *mm = contact(who)-&gt;manager();
-
-        // Tell the message manager that the buddy is done typing
-        mm-&gt;receivedTypingMsg(contact(who), false);
-
-        justMe.append(myself());
-
+    //Parse the message for it&apos;s properties
+    kdDebug(14180) &lt;&lt; &quot;Original message is &apos;&quot; &lt;&lt; msg &lt;&lt; &quot;&apos;&quot; &lt;&lt; endl;
+    //kdDebug(14180) &lt;&lt; &quot;Message color is &quot; &lt;&lt; getMsgColor(msg) &lt;&lt; endl;
+    QColor fgColor = getMsgColor( msg );
         if (tm == 0)
                 msgDT.setTime_t(time(0L));
@@ -622,24 +623,32 @@ void YahooAccount::slotGotIm( const QStr
                 msgDT.setTime_t(tm, Qt::LocalTime);
 
-        KopeteMessage kmsg(msgDT, contact(who), justMe, msg,
-                                        KopeteMessage::Inbound , KopeteMessage::PlainText);
-
-        QString newMsg = stripMsgColorCodes(kmsg.plainBody());
+    QString newMsgText = stripMsgColorCodes( msg );
 
-        kmsg.setFg(getMsgColor(msg));
-//      kdDebug(14180) &lt;&lt; &quot;Message color is &quot; &lt;&lt; getMsgColor(msg) &lt;&lt; endl;
+    kdDebug(14180) &lt;&lt; &quot;Message after stripping color codes &apos;&quot; &lt;&lt; newMsgText &lt;&lt; &quot;&apos;&quot; &lt;&lt; endl;
 
-        if (newMsg.find(&quot;&lt;font&quot;) != -1)
+        if (newMsgText.find(&quot;&lt;font&quot;) != -1)
         {
-                msgFont.setFamily(newMsg.section(&apos;&quot;&apos;, 1,1));
+                msgFont.setFamily(newMsgText.section(&apos;&quot;&apos;, 1,1));
 
-                if (newMsg.find(&quot;size&quot;))
-                        msgFont.setPointSize(newMsg.section(&apos;&quot;&apos;, 3,3).toInt());
+                if (newMsgText.find(&quot;size&quot;))
+                        msgFont.setPointSize(newMsgText.section(&apos;&quot;&apos;, 3,3).toInt());
 
                 //remove the font encoding since we handle them ourselves
-                newMsg.remove(newMsg.mid(0, newMsg.find(&apos;&gt;&apos;)+1));
+                newMsgText.remove(newMsgText.mid(0, newMsgText.find(&apos;&gt;&apos;)+1));
         }
-        //set the new body that has correct HTML
-        kmsg.setBody(newMsg, KopeteMessage::RichText);
+
+    kdDebug(14180) &lt;&lt; &quot;Message after removing font tags &apos;&quot; &lt;&lt; newMsgText &lt;&lt; &quot;&apos;&quot; &lt;&lt; endl;
+
+        KopeteMessageManager *mm = contact(who)-&gt;manager();
+
+        // Tell the message manager that the buddy is done typing
+        mm-&gt;receivedTypingMsg(contact(who), false);
+
+        justMe.append(myself());
+
+        KopeteMessage kmsg(msgDT, contact(who), justMe, newMsgText,
+                                        KopeteMessage::Inbound , KopeteMessage::RichText);
+
+        kmsg.setFg( fgColor );
         kmsg.setFont(msgFont);
         mm-&gt;appendMessage(kmsg);


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>271762</commentid>
    <comment_count>7</comment_count>
    <who name="Matt Rogers">mattr</who>
    <bug_when>2004-09-26 16:03:31 +0000</bug_when>
    <thetext>*** Bug 90257 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>