ayttm-commits
[Top][All Lists]
Advanced

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

[Ayttm-commits] CVS: ayttm/modules/yahoo2/libyahoo2 libyahoo2.c,1.5,1.6


From: Philip S Tellis <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/yahoo2/libyahoo2 libyahoo2.c,1.5,1.6 yahoo2.h,1.3,1.4 yahoo_util.h,1.3,1.4
Date: Tue, 21 Jan 2003 07:01:51 -0500

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

Modified Files:
        libyahoo2.c yahoo2.h yahoo_util.h 
Log Message:
yahoo group rename done.  now wait for the core

Index: libyahoo2.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2/libyahoo2.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- libyahoo2.c 21 Jan 2003 11:03:21 -0000      1.5
+++ libyahoo2.c 21 Jan 2003 12:01:23 -0000      1.6
@@ -133,7 +133,7 @@
        YAHOO_SERVICE_ADDIDENT, /* 0x10 */
        YAHOO_SERVICE_ADDIGNORE,
        YAHOO_SERVICE_PING,
-       YAHOO_SERVICE_GROUPRENAME,
+       YAHOO_SERVICE_GOTGROUPRENAME, /* > 1, 36(old), 37(new) */
        YAHOO_SERVICE_SYSMESSAGE = 0x14,
        YAHOO_SERVICE_PASSTHROUGH2 = 0x16,
        YAHOO_SERVICE_CONFINVITE = 0x18,
@@ -161,6 +161,7 @@
        YAHOO_SERVICE_REMBUDDY,
        YAHOO_SERVICE_IGNORECONTACT,    /* > 1, 7, 13 < 1, 66, 13, 0*/
        YAHOO_SERVICE_REJECTCONTACT,
+       YAHOO_SERVICE_GROUPRENAME = 0x89, /* > 1, 65(new), 66(0), 67(old) */
        YAHOO_SERVICE_CHATONLINE = 0x96,
        YAHOO_SERVICE_CHATGOTO,
        YAHOO_SERVICE_CHATJOIN,
@@ -296,17 +297,17 @@
                (*(buf) = (unsigned char)((data)>>8)&0xff), \
                (*((buf)+1) = (unsigned char)(data)&0xff),  \
                2)
-#define yahoo_get16(buf) ((((*(buf))<<8)&0xff00) + ((*((buf)+1)) & 0xff))
+#define yahoo_get16(buf) ((((*(buf))&0xff)<<8) + ((*((buf)+1)) & 0xff))
 #define yahoo_put32(buf, data) ( \
                (*((buf)) = (unsigned char)((data)>>24)&0xff), \
                (*((buf)+1) = (unsigned char)((data)>>16)&0xff), \
                (*((buf)+2) = (unsigned char)((data)>>8)&0xff), \
                (*((buf)+3) = (unsigned char)(data)&0xff), \
                4)
-#define yahoo_get32(buf) ((((*(buf))<<24)&0xff000000) + \
-               (((*((buf)+1))<<16)&0x00ff0000) + \
-               (((*((buf)+2))<< 8)&0x0000ff00) + \
-               (((*((buf)+3)    )&0x000000ff)))
+#define yahoo_get32(buf) ((((*(buf)   )&0xff)<<24) + \
+                        (((*((buf)+1))&0xff)<<16) + \
+                        (((*((buf)+2))&0xff)<< 8) + \
+                        (((*((buf)+3))&0xff)))
 
 static void yahoo_packet_read(struct yahoo_packet *pkt, unsigned char *data, 
int len)
 {
@@ -1433,6 +1434,7 @@
        case YAHOO_SERVICE_ADDIDENT:
        case YAHOO_SERVICE_ADDIGNORE:
        case YAHOO_SERVICE_PING:
+       case YAHOO_SERVICE_GOTGROUPRENAME:
        case YAHOO_SERVICE_GROUPRENAME:
        case YAHOO_SERVICE_PASSTHROUGH2:
        case YAHOO_SERVICE_CHATLOGON:
@@ -1880,6 +1882,23 @@
        yahoo_packet_hash(pkt, 1, yd->user);
        yahoo_packet_hash(pkt, 7, who);
        yahoo_packet_hash(pkt, 65, old_group);
+       yahoo_send_packet(yd, pkt, 0);
+       yahoo_packet_free(pkt);
+}
+
+void yahoo_group_rename(int id, const char *old_group, const char *new_group)
+{
+       struct yahoo_data *yd = find_conn_by_id(id);
+       struct yahoo_packet *pkt = NULL;
+
+       if(!yd)
+               return;
+
+       pkt = yahoo_packet_new(YAHOO_SERVICE_GROUPRENAME, 
YAHOO_STATUS_AVAILABLE, yd->id);
+       yahoo_packet_hash(pkt, 1, yd->user);
+       yahoo_packet_hash(pkt, 65, old_group);
+       yahoo_packet_hash(pkt, 67, new_group);
+
        yahoo_send_packet(yd, pkt, 0);
        yahoo_packet_free(pkt);
 }

Index: yahoo2.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2/yahoo2.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- yahoo2.h    19 Jan 2003 13:58:05 -0000      1.3
+++ yahoo2.h    21 Jan 2003 12:01:23 -0000      1.4
@@ -69,6 +69,7 @@
 /* if unignore is true, unignore, else ignore */
 void yahoo_ignore_buddy(int id, const char *who, int unignore);
 void yahoo_change_buddy_group(int id, const char *who, const char *old_group, 
const char *new_group);
+void yahoo_group_rename(int id, const char *old_group, const char *new_group);
 
 void yahoo_conference_invite(int id, const char * from, YList *who, const char 
*room, const char *msg);
 void yahoo_conference_addinvite(int id, const char * from, const char *who, 
const char *room, const YList * members, const char *msg);

Index: yahoo_util.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2/yahoo_util.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- yahoo_util.h        19 Jan 2003 13:58:05 -0000      1.3
+++ yahoo_util.h        21 Jan 2003 12:01:23 -0000      1.4
@@ -90,6 +90,10 @@
 #define MAX(x,y) ((x)>(y)?(x):(y))
 #endif
 
+/* 
+ * The following three functions return newly allocated memory.
+ * You must free it yourself
+ */
 char * y_string_append(char * str, char * append);
 char * y_str_to_utf8(const char * in);
 char * y_utf8_to_str(const char * in);





reply via email to

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