On Sat, Jan 12, 2002 at 07:16:00PM +0000, Aquarius wrote:
> On Sun, Dec 16, 2001 at 03:23:21PM -0600, Colin Watson wrote:
> > On Mon, Dec 10, 2001 at 09:02:07PM +0000, Aquarius wrote:
> > > KYahoo seems to be appending the string ";0,00" to things other 
> > > chatters type. See transcript excerpt below.
> > 
> > Could you try it with debugging messages turned on (Yahoo / Debug
> > Messages)? I'd try myself, but it wants me to do registration stuff, and
> > life's too short, as you know. :)
> 
> The suffixed characters seem to be coming up in the debug messages too:
> 
> Received packet:
>       Service = (6) Message
>       Real ID = [my ID snipped]
>       Active ID = [my ID snipped]
>       Connection ID = 6E963178
>       Magic ID = 72C6
>       Unknown Flag 1 = 72C11F3E
>       Message Type = 1
>       Raw Content = [other user ID snipped],,right I'll call you....;0,00
>       Message ID = [other user ID snipped]
>       Message = right I'll call you....;0,00

OK. There's a patch in libyahoo CVS that looks relevant. It would
probably be better to build kyahoo against the new libyahoo packages
rather than hacking its local copy, though.

I see somebody is planning to adopt kyahoo, so I'm cc'ing this to him.
The libyahoo patch is below in case it's useful.

--- kyahoo-0.7.0/kyahoo/libyahoo/libyahoo.c     Mon May  7 03:57:31 2001
+++ cvs/libyahoo/libyahoo.c     Tue Dec  4 01:35:26 2001
@@ -3222,6 +3574,8 @@ int yahoo_parsepacket_message(struct yah
 {
        char *content;
        char *tmp_id;
+       char *tmp_msg;
+       char *tmp_imvironment;
        int i, j, section;
 
        if (pkt->msgtype == YAHOO_MSGTYPE_OFFLINE)
@@ -3232,9 +3586,14 @@ int yahoo_parsepacket_message(struct yah
        /* Make working copy of content */
        content = strdup(inpkt->content);
        tmp_id = strdup(content);
+       tmp_msg = strdup(content);
+       tmp_imvironment = strdup(content);
 
        /* initialize */
        pkt->msg_status = 0;
+       pkt->imvironment_enabled = 0;
+       pkt->imvironment_unkn1 = 0;
+       pkt->imvironment_unkn2 = 0;
 
        /* possible message content formats: */
 /*     userid(#) *//* msgtype == YAHOO_MSGTYPE_STATUS */
@@ -3248,6 +3607,8 @@ int yahoo_parsepacket_message(struct yah
        j = 0;
        section = 0;
        tmp_id[0] = 0;
+       tmp_msg[0] = 0;
+       tmp_imvironment[0] = 0;
        while (i < strlen(content))
        {
                char ch = content[i];
@@ -3294,10 +3655,71 @@ int yahoo_parsepacket_message(struct yah
                                }
                        }
                }
+               else if (section == 3) /* parsing message text */
+               {
+                       if ( ch == 6 )
+                       {
+                               j = 0;
+                               section = 4;
+                       }
+                       else
+                       {
+                               tmp_msg[j++] = ch;
+                               tmp_msg[j] = 0;
+                       }
+               }
+               else if (section == 4) /* parsing invironment name */
+               {
+                       if ( ch == ';' )
+                       {
+                               j = 0;
+                               section = 5;
+                       }
+                       else
+                       {
+                               tmp_imvironment[j++] = ch;
+                               tmp_imvironment[j] = 0;
+                       }
+               }
+               else if (section == 5) /* parsing imvir enabled flag */
+               {
+                       if (ch == ',')
+                       {
+                               j = 0;
+                               section = 6;
+                       }
+                       else
+                       {
+                               if (isdigit((int) ch))
+                               {
+                                       pkt->imvironment_enabled *= 10;
+                                       pkt->imvironment_enabled += ch - '0';
+                               }
+                       }
+               }
+               else if (section == 6) /* parsing imvir unkn1 flag */
+               {
+                       if (ch == 7)
+                       {
+                               j = 0;
+                               section = 7;
+                       }
+                       else
+                       {
+                               if (isdigit((int) ch))
+                               {
+                                       pkt->imvironment_unkn1 *= 10;
+                                       pkt->imvironment_unkn1 += ch - '0';
+                               }
+                       }
+               }
                else
                {
-                       pkt->msg = strdup(&content[i]);
-                       break;
+                       if (isdigit((int) ch))
+                       {
+                               pkt->imvironment_unkn2 *= 10;
+                               pkt->imvironment_unkn2 += ch - '0';
+                       }
                }
 
                i++;
@@ -3305,6 +3727,11 @@ int yahoo_parsepacket_message(struct yah
 
        /* do stuff with extracted parts */
        pkt->msg_id = strdup(tmp_id);
+       if ( tmp_msg[0] != 0 )
+       {
+               pkt->msg = strdup(tmp_msg);
+       }
+       pkt->imvironment_name = strdup(tmp_imvironment);
 
        /* handle empty message case */
        /* don't pass a message if it's just a status update */
@@ -3313,8 +3740,32 @@ int yahoo_parsepacket_message(struct yah
                pkt->msg = strdup("");
        }
 
+#if 0  
+    /*
+       Note: 
+           Temporarily disable this, see if there're any side effect(s).
+           We don't want to strip the escape sequence for bold, underline and
+           italic.  (with this disabled, we'll have that 'squiggle' trailing
+           character after each msg.  Any idea what it's for?)
+     */
+
+       if (NULL != pkt->msg)
+       {
+               /* strip off any trailing control-chars */
+               for (i = 0; i <= strlen(pkt->msg); i++)
+               {
+                       if (!isprint(pkt->msg[i]))
+                       {
+                               pkt->msg[i] = '\0';
+                       }
+               }
+       }
+#endif
+
        /* free working variables */
        FREE(tmp_id);
+       FREE(tmp_imvironment);
+       FREE(tmp_msg);
        FREE(content);
 
        /* Return ok for success */
--- kyahoo-0.7.0/kyahoo/libyahoo/libyahoo.h     Mon May  7 03:53:30 2001
+++ cvs/libyahoo/libyahoo.h     Sat Dec  1 01:22:17 2001
@@ -245,6 +256,12 @@ struct yahoo_packet
        /* Group names for renaming */
        char *group_old;                        /* Old group name */
        char *group_new;                        /* New group name */
+
+       /* New IMvironments stuff "name;[01],0 0" */
+       char *imvironment_name;     /* Name of IMvironment */
+       int imvironment_enabled;    /* ? - is an imvironment in use? */
+       int imvironment_unkn1;
+       int imvironment_unkn2;
 };
 
 /* Misc contants */

Cheers,

-- 
Colin Watson                                  [EMAIL PROTECTED]

Reply via email to