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.8,1.9


From: Philip S Tellis <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/yahoo2/libyahoo2 libyahoo2.c,1.8,1.9 yahoo2.h,1.6,1.7 yahoo2_types.h,1.2,1.3
Date: Wed, 05 Feb 2003 10:23:30 -0500

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

Modified Files:
        libyahoo2.c yahoo2.h yahoo2_types.h 
Log Message:
support for modifying addressbook in yahoo

Index: libyahoo2.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2/libyahoo2.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- libyahoo2.c 29 Jan 2003 15:25:55 -0000      1.8
+++ libyahoo2.c 5 Feb 2003 15:23:27 -0000       1.9
@@ -1582,6 +1582,13 @@
                en = strchr(st, '"'); *en++ = '\0';
                yab->mphone = yahoo_xmldecode(st);
        }
+
+       st = strstr(en, "dbid=\"");
+       if(st) {
+               st += strlen("dbid=\"");
+               en = strchr(st, '"'); *en++ = '\0';
+               yab->dbid = atoi(st);
+       }
 }
 
 static struct yab * yahoo_getyab(struct yahoo_data *yd)
@@ -1956,6 +1963,7 @@
        char url[1024];
        char buff[1024];
        char *temp;
+       int size = sizeof(url)-1;
 
        if(!yd)
                return;
@@ -1966,55 +1974,63 @@
        nyd->type = YAHOO_CONNECTION_YAB;
        nyd->buddies = yd->buddies;
 
-       strncpy(url, "http://insider.msg.yahoo.com/ycontent/?addab2=0";, 
sizeof(url));
+       strncpy(url, "http://insider.msg.yahoo.com/ycontent/?addab2=0";, size);
+
+       if(yab->dbid) {
+               /* change existing yab */
+               char tmp[32];
+               strncat(url, "&ee=1&ow=1&id=", size - strlen(url));
+               snprintf(tmp, sizeof(tmp), "%d", yab->dbid);
+               strncat(url, tmp, size - strlen(url));
+       }
 
        if(yab->fname) {
-               strncat(url, "&fn=", sizeof(url) - strlen(url));
+               strncat(url, "&fn=", size - strlen(url));
                temp = yahoo_urlencode(yab->fname);
-               strncat(url, temp, sizeof(url) - strlen(url));
+               strncat(url, temp, size - strlen(url));
                free(temp);
        }
        if(yab->lname) {
-               strncat(url, "&ln=", sizeof(url) - strlen(url));
+               strncat(url, "&ln=", size - strlen(url));
                temp = yahoo_urlencode(yab->lname);
-               strncat(url, temp, sizeof(url) - strlen(url));
+               strncat(url, temp, size - strlen(url));
                free(temp);
        }
-       strncat(url, "&yid=", sizeof(url) - strlen(url));
+       strncat(url, "&yid=", size - strlen(url));
        temp = yahoo_urlencode(yab->id);
-       strncat(url, temp, sizeof(url) - strlen(url));
+       strncat(url, temp, size - strlen(url));
        free(temp);
        if(yab->nname) {
-               strncat(url, "&nn=", sizeof(url) - strlen(url));
+               strncat(url, "&nn=", size - strlen(url));
                temp = yahoo_urlencode(yab->nname);
-               strncat(url, temp, sizeof(url) - strlen(url));
+               strncat(url, temp, size - strlen(url));
                free(temp);
        }
        if(yab->email) {
-               strncat(url, "&e=", sizeof(url) - strlen(url));
+               strncat(url, "&e=", size - strlen(url));
                temp = yahoo_urlencode(yab->email);
-               strncat(url, temp, sizeof(url) - strlen(url));
+               strncat(url, temp, size - strlen(url));
                free(temp);
        }
        if(yab->hphone) {
-               strncat(url, "&hp=", sizeof(url) - strlen(url));
+               strncat(url, "&hp=", size - strlen(url));
                temp = yahoo_urlencode(yab->hphone);
-               strncat(url, temp, sizeof(url) - strlen(url));
+               strncat(url, temp, size - strlen(url));
                free(temp);
        }
        if(yab->wphone) {
-               strncat(url, "&wp=", sizeof(url) - strlen(url));
+               strncat(url, "&wp=", size - strlen(url));
                temp = yahoo_urlencode(yab->wphone);
-               strncat(url, temp, sizeof(url) - strlen(url));
+               strncat(url, temp, size - strlen(url));
                free(temp);
        }
        if(yab->mphone) {
-               strncat(url, "&mp=", sizeof(url) - strlen(url));
+               strncat(url, "&mp=", size - strlen(url));
                temp = yahoo_urlencode(yab->mphone);
-               strncat(url, temp, sizeof(url) - strlen(url));
+               strncat(url, temp, size - strlen(url));
                free(temp);
        }
-       strncat(url, "&pp=0", sizeof(url) - strlen(url));
+       strncat(url, "&pp=0", size - strlen(url));
 
        snprintf(buff, sizeof(buff), "Y=%s; T=%s",
                        yd->cookie_y, yd->cookie_t);

Index: yahoo2.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2/yahoo2.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- yahoo2.h    29 Jan 2003 15:25:55 -0000      1.6
+++ yahoo2.h    5 Feb 2003 15:23:27 -0000       1.7
@@ -53,6 +53,8 @@
 void yahoo_get_list(int id);
 /* download buddy contact information from your yahoo addressbook */
 void yahoo_get_yab(int id);
+/* add an address book entry.  if yab->dbid is set, it will */
+/* modify that entry else it creates a new entry */
 void yahoo_add_yab(int id, struct yab * yab);
 void yahoo_keepalive(int id);
 

Index: yahoo2_types.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/yahoo2/libyahoo2/yahoo2_types.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- yahoo2_types.h      24 Jan 2003 13:34:41 -0000      1.2
+++ yahoo2_types.h      5 Feb 2003 15:23:27 -0000       1.3
@@ -144,6 +144,7 @@
        char *hphone;
        char *wphone;
        char *mphone;
+       int  dbid;
 };
 
 struct yahoo_buddy {





reply via email to

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