Changeset cf02dd6 for libfaim/email.c


Ignore:
Timestamp:
Dec 10, 2003, 3:20:45 PM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
b1fe407
Parents:
8c46404
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfaim/email.c

    re374dee rcf02dd6  
    1919 * @return Return 0 if no errors, otherwise return the error number.
    2020 */
    21 faim_export int aim_email_sendcookies(aim_session_t *sess, aim_conn_t *conn)
    22 {
     21faim_export int aim_email_sendcookies(aim_session_t *sess)
     22{
     23        aim_conn_t *conn;
    2324        aim_frame_t *fr;
    2425        aim_snacid_t snacid;
    2526
    26         if (!sess || !conn)
     27        if (!sess || !(conn = aim_conn_findbygroup(sess, AIM_CB_FAM_EML)))
    2728                return -EINVAL;
    2829
     
    8182        fu8_t *cookie8, *cookie16;
    8283        int tmp, havenewmail = 0; /* Used to tell the client we have _new_ mail */
     84
     85        char *alertitle = NULL, *alerturl = NULL;
    8386
    8487        cookie8 = aimbs_getraw(bs, 8); /* Possibly the code used to log you in to mail? */
     
    105108        new->cookie16 = cookie16;
    106109
    107         tlvlist = aim_readtlvchain_num(bs, aimbs_get16(bs));
    108 
    109         tmp = aim_gettlv16(tlvlist, 0x0080, 1);
     110        tlvlist = aim_tlvlist_readnum(bs, aimbs_get16(bs));
     111
     112        tmp = aim_tlv_get16(tlvlist, 0x0080, 1);
    110113        if (tmp) {
    111114                if (new->nummsgs < tmp)
     
    118121                new->nummsgs++; /* We know we have at least 1 new email */
    119122        }
    120         new->url = aim_gettlv_str(tlvlist, 0x0007, 1);
    121         if (!(new->unread = aim_gettlv8(tlvlist, 0x0081, 1))) {
     123        new->url = aim_tlv_getstr(tlvlist, 0x0007, 1);
     124        if (!(new->unread = aim_tlv_get8(tlvlist, 0x0081, 1))) {
    122125                havenewmail = 0;
    123126                new->nummsgs = 0;
    124127        }
    125         new->domain = aim_gettlv_str(tlvlist, 0x0082, 1);
    126         new->flag = aim_gettlv16(tlvlist, 0x0084, 1);
    127 
     128        new->domain = aim_tlv_getstr(tlvlist, 0x0082, 1);
     129        new->flag = aim_tlv_get16(tlvlist, 0x0084, 1);
     130
     131        alertitle = aim_tlv_getstr(tlvlist, 0x0005, 1);
     132        alerturl  = aim_tlv_getstr(tlvlist, 0x000d, 1);
     133       
    128134        if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
    129                 ret = userfunc(sess, rx, new, havenewmail);
    130 
    131         aim_freetlvchain(&tlvlist);
     135                ret = userfunc(sess, rx, new, havenewmail, alertitle, (alerturl ? alerturl + 2 : NULL));
     136
     137        aim_tlvlist_free(&tlvlist);
     138
     139        free(alertitle);
     140        free(alerturl);
    132141
    133142        return ret;
     
    141150 * @return Return 0 if no errors, otherwise return the error number.
    142151 */
    143 faim_export int aim_email_activate(aim_session_t *sess, aim_conn_t *conn)
    144 {
     152faim_export int aim_email_activate(aim_session_t *sess)
     153{
     154        aim_conn_t *conn;
    145155        aim_frame_t *fr;
    146156        aim_snacid_t snacid;
    147157
    148         if (!sess || !conn)
     158        if (!sess || !(conn = aim_conn_findbygroup(sess, AIM_CB_FAM_EML)))
    149159                return -EINVAL;
    150160
Note: See TracChangeset for help on using the changeset viewer.