ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/modules/yahoo2 yahoo.c,1.41,1.42


From: Philip S Tellis <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/yahoo2 yahoo.c,1.41,1.42
Date: Tue, 11 Feb 2003 01:22:04 -0500

Update of /cvsroot/ayttm/ayttm/modules/yahoo2
In directory subversions:/tmp/cvs-serv15508/modules/yahoo2

Modified Files:
        yahoo.c 
Log Message:
added add_dummy_contact to chat with buddies not on your contact list

Index: yahoo.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/yahoo.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- yahoo.c     7 Feb 2003 05:24:03 -0000       1.41
+++ yahoo.c     11 Feb 2003 06:21:59 -0000      1.42
@@ -446,7 +446,7 @@
        return NULL;
 }
 
-static void eb_yahoo_decode_yahoo_colors(char *buffer, char *msg)
+static void eb_yahoo_decode_yahoo_colors(char *buffer, const char *msg)
 {
        char *yahoo_colors[] =
        {
@@ -521,7 +521,7 @@
                                                 yahoo_colors[color_index]) - 
1);
                                if ( ! color_index ) {
                                  char *tbuf = buffer + strlen(buffer);
-                                 char *tmsg = msg + string_index;
+                                 const char *tmsg = msg + string_index;
 
                                  for(  ; *tmsg != 'm' ; string_index ++ ) {
                                    * tbuf++ = * tmsg++;
@@ -758,42 +758,32 @@
                if(utf8)
                        umsg = y_utf8_to_str(msg);
 
+               sender = find_account_by_handle(who, SERVICE_INFO.protocol_id);
+               if (sender == NULL) {
+                       sender = eb_yahoo_new_account(who);
+                       add_dummy_contact(who, sender);
+               }
+               receiver = yahoo_find_local_account_by_id(id);
+
                if(tm) {
                        char newmessage[2048];
-                       char timestr[2048];
+                       char timestr[256];
 
                        strncpy(timestr, ctime(&tm), sizeof(timestr));
                        timestr[strlen(timestr) - 1] = '\0';
 
-                       sprintf(newmessage, _("<FONT COLOR=\"#0000FF\">[Offline 
message at %s]</FONT><BR>%s"), timestr, umsg);
+                       snprintf(newmessage, sizeof(newmessage), _("<FONT 
COLOR=\"#0000FF\">[Offline message at %s]</FONT><BR>%s"), timestr, umsg);
 
-                       sender = find_account_by_handle(who, 
SERVICE_INFO.protocol_id);
-                       if (sender == NULL) {
-                               sender = eb_yahoo_new_account(who);
-                               add_unknown(sender);
-                               update_contact_list();
-                       }
-                       receiver = yahoo_find_local_account_by_id(id);
-                       eb_yahoo_decode_yahoo_colors(buff, newmessage);
-                       eb_parse_incoming_message(receiver, sender, buff);
                        LOG(("<incoming offline message: %s: %s>", who, umsg));
+                       eb_yahoo_decode_yahoo_colors(buff, newmessage);
 
                } else {
-                       sender = find_account_by_handle(who, 
SERVICE_INFO.protocol_id);
-
-                       if (sender == NULL) {
-                               sender = eb_yahoo_new_account(who);
-                               add_unknown(sender);
-                               yahoo_refresh(id);
-                               update_contact_list();
-                       }
-                       receiver = yahoo_find_local_account_by_id(id);
 
                        LOG(("<incoming message: %s: %s>", who, umsg));
                        eb_yahoo_decode_yahoo_colors(buff, umsg);
-                       eb_parse_incoming_message(receiver, sender, buff);
 
                }
+               eb_parse_incoming_message(receiver, sender, buff);
 
                if(utf8)
                        FREE(umsg);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]