Changeset 7869e48 for libfaim/locate.c


Ignore:
Timestamp:
Jan 12, 2013, 1:43:13 PM (11 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
e3a0d71, 4485285
Parents:
4626016
git-author:
Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
git-committer:
Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
Message:
Remove trailing whitespace

This commit was made with the command sequence

    for i in $(git ls-files | tr '\n' ' ');
    do
      echo $i; sed -i s'/\s\+$//g' "$(readlink -f $i)";
    done
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfaim/locate.c

    r6e3980e r7869e48  
    33 *
    44 * The functions here are responsible for requesting and parsing information-
    5  * gathering SNACs.  Or something like that.  This family contains the SNACs 
     5 * gathering SNACs.  Or something like that.  This family contains the SNACs
    66 * for getting and setting info, away messages, directory profile thingy, etc.
    77 */
     
    1414
    1515/*
    16  * Capability blocks. 
     16 * Capability blocks.
    1717 *
    1818 * These are CLSIDs. They should actually be of the form:
     
    3636         */
    3737        {AIM_CAPS_ICHAT,
    38          {0x09, 0x46, 0x00, 0x00, 0x4c, 0x7f, 0x11, 0xd1, 
     38         {0x09, 0x46, 0x00, 0x00, 0x4c, 0x7f, 0x11, 0xd1,
    3939          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    4040
    4141        {AIM_CAPS_SECUREIM,
    42          {0x09, 0x46, 0x00, 0x01, 0x4c, 0x7f, 0x11, 0xd1, 
     42         {0x09, 0x46, 0x00, 0x01, 0x4c, 0x7f, 0x11, 0xd1,
    4343          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    4444
    4545        {AIM_CAPS_VIDEO,
    46          {0x09, 0x46, 0x01, 0x00, 0x4c, 0x7f, 0x11, 0xd1, 
    47           0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    48 
    49         /*
    50          * Not really sure about this one.  In an email from 
    51          * 26 Sep 2003, Matthew Sachs suggested that, "this 
     46         {0x09, 0x46, 0x01, 0x00, 0x4c, 0x7f, 0x11, 0xd1,
     47          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
     48
     49        /*
     50         * Not really sure about this one.  In an email from
     51         * 26 Sep 2003, Matthew Sachs suggested that, "this
    5252         * is probably the capability for the SMS features."
    5353         */
    5454        {AIM_CAPS_SMS,
    55          {0x09, 0x46, 0x01, 0xff, 0x4c, 0x7f, 0x11, 0xd1, 
     55         {0x09, 0x46, 0x01, 0xff, 0x4c, 0x7f, 0x11, 0xd1,
    5656          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    5757
    5858        {AIM_CAPS_GENERICUNKNOWN,
    59          {0x09, 0x46, 0xf0, 0x03, 0x4c, 0x7f, 0x11, 0xd1, 
     59         {0x09, 0x46, 0xf0, 0x03, 0x4c, 0x7f, 0x11, 0xd1,
    6060          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    6161
    6262        {AIM_CAPS_GENERICUNKNOWN,
    63          {0x09, 0x46, 0xf0, 0x04, 0x4c, 0x7f, 0x11, 0xd1, 
     63         {0x09, 0x46, 0xf0, 0x04, 0x4c, 0x7f, 0x11, 0xd1,
    6464          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    6565
    6666        {AIM_CAPS_GENERICUNKNOWN,
    67          {0x09, 0x46, 0xf0, 0x05, 0x4c, 0x7f, 0x11, 0xd1, 
     67         {0x09, 0x46, 0xf0, 0x05, 0x4c, 0x7f, 0x11, 0xd1,
    6868          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    6969
    7070        {AIM_CAPS_HIPTOP,
    71          {0x09, 0x46, 0x13, 0x23, 0x4c, 0x7f, 0x11, 0xd1, 
     71         {0x09, 0x46, 0x13, 0x23, 0x4c, 0x7f, 0x11, 0xd1,
    7272          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    7373
    7474        {AIM_CAPS_VOICE,
    75          {0x09, 0x46, 0x13, 0x41, 0x4c, 0x7f, 0x11, 0xd1, 
     75         {0x09, 0x46, 0x13, 0x41, 0x4c, 0x7f, 0x11, 0xd1,
    7676          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    7777
    7878        {AIM_CAPS_SENDFILE,
    79          {0x09, 0x46, 0x13, 0x43, 0x4c, 0x7f, 0x11, 0xd1, 
     79         {0x09, 0x46, 0x13, 0x43, 0x4c, 0x7f, 0x11, 0xd1,
    8080          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    8181
    8282        {AIM_CAPS_ICQ_DIRECT,
    83          {0x09, 0x46, 0x13, 0x44, 0x4c, 0x7f, 0x11, 0xd1, 
     83         {0x09, 0x46, 0x13, 0x44, 0x4c, 0x7f, 0x11, 0xd1,
    8484          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    8585
    8686        {AIM_CAPS_DIRECTIM,
    87          {0x09, 0x46, 0x13, 0x45, 0x4c, 0x7f, 0x11, 0xd1, 
     87         {0x09, 0x46, 0x13, 0x45, 0x4c, 0x7f, 0x11, 0xd1,
    8888          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    8989
    9090        {AIM_CAPS_BUDDYICON,
    91          {0x09, 0x46, 0x13, 0x46, 0x4c, 0x7f, 0x11, 0xd1, 
     91         {0x09, 0x46, 0x13, 0x46, 0x4c, 0x7f, 0x11, 0xd1,
    9292          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    9393
     
    108108
    109109        /*
    110          * Indeed, there are two of these.  The former appears to be correct, 
    111          * but in some versions of winaim, the second one is set.  Either they 
    112          * forgot to fix endianness, or they made a typo. It really doesn't 
     110         * Indeed, there are two of these.  The former appears to be correct,
     111         * but in some versions of winaim, the second one is set.  Either they
     112         * forgot to fix endianness, or they made a typo. It really doesn't
    113113         * matter which.
    114114         */
     
    125125
    126126        /*
    127          * Setting this lets AIM users receive messages from ICQ users, and ICQ 
    128          * users receive messages from AIM users.  It also lets ICQ users show 
    129          * up in buddy lists for AIM users, and AIM users show up in buddy lists 
    130          * for ICQ users.  And ICQ privacy/invisibility acts like AIM privacy, 
    131          * in that if you add a user to your deny list, you will not be able to 
    132          * see them as online (previous you could still see them, but they 
     127         * Setting this lets AIM users receive messages from ICQ users, and ICQ
     128         * users receive messages from AIM users.  It also lets ICQ users show
     129         * up in buddy lists for AIM users, and AIM users show up in buddy lists
     130         * for ICQ users.  And ICQ privacy/invisibility acts like AIM privacy,
     131         * in that if you add a user to your deny list, you will not be able to
     132         * see them as online (previous you could still see them, but they
    133133         * couldn't see you.
    134134         */
     
    149149         */
    150150        {AIM_CAPS_CHAT,
    151          {0x74, 0x8f, 0x24, 0x20, 0x62, 0x87, 0x11, 0xd1, 
     151         {0x74, 0x8f, 0x24, 0x20, 0x62, 0x87, 0x11, 0xd1,
    152152          0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}},
    153153
     
    164164        /* This is added by the servers and it only shows up for ourselves... */
    165165        {AIM_CAPS_GENERICUNKNOWN,
    166          {0x97, 0xb1, 0x27, 0x51, 0x24, 0x3c, 0x43, 0x34, 
     166         {0x97, 0xb1, 0x27, 0x51, 0x24, 0x3c, 0x43, 0x34,
    167167          0xad, 0x22, 0xd6, 0xab, 0xf7, 0x3f, 0x14, 0x09}},
    168168
    169         {AIM_CAPS_APINFO, 
     169        {AIM_CAPS_APINFO,
    170170         {0xaa, 0x4a, 0x32, 0xb5, 0xf8, 0x84, 0x48, 0xc6,
    171171          0xa3, 0xd7, 0x8c, 0x50, 0x97, 0x19, 0xfd, 0x5b}},
     
    183183
    184184/*
    185  * Add the userinfo to our linked list.  If we already have userinfo 
     185 * Add the userinfo to our linked list.  If we already have userinfo
    186186 * for this buddy, then just overwrite parts of the old data.
    187187 * @param userinfo Contains the new information for the buddy.
     
    260260
    261261/**
    262  * Remove this screen name from our queue.  If this info was resquested 
     262 * Remove this screen name from our queue.  If this info was resquested
    263263 * by our info request queue, then pop the next element off of the queue.
    264264 *
    265265 * @param sess The aim session.
    266266 * @param sn Screen name of the info we just received.
    267  * @return True if the request was explicit (client requested the info), 
     267 * @return True if the request was explicit (client requested the info),
    268268 *         false if the request was implicit (libfaim request the info).
    269269 */
     
    450450
    451451/*
    452  * AIM is fairly regular about providing user info.  This is a generic 
     452 * AIM is fairly regular about providing user info.  This is a generic
    453453 * routine to extract it in its standard form.
    454454 */
     
    465465
    466466        /*
    467          * Screen name.  Stored as an unterminated string prepended with a 
     467         * Screen name.  Stored as an unterminated string prepended with a
    468468         * byte containing its length.
    469469         */
     
    477477
    478478        /*
    479          * TLV Count. Unsigned short representing the number of 
     479         * TLV Count. Unsigned short representing the number of
    480480         * Type-Length-Value triples that follow.
    481481         */
    482482        tlvcnt = aimbs_get16(bs);
    483483
    484         /* 
     484        /*
    485485         * Parse out the Type-Length-Value triples as they're found.
    486486         */
     
    497497                        /*
    498498                         * Type = 0x0001: User flags
    499                          * 
     499                         *
    500500                         * Specified as any of the following ORed together:
    501501                         *      0x0001  Trial (user less than 60days)
     
    503503                         *      0x0004  AOL Main Service user
    504504                         *      0x0008  Unknown bit 4
    505                          *      0x0010  Free (AIM) user 
     505                         *      0x0010  Free (AIM) user
    506506                         *      0x0020  Away
    507507                         *      0x0400  ActiveBuddy
     
    513513                } else if (type == 0x0002) {
    514514                        /*
    515                          * Type = 0x0002: Account creation time. 
     515                         * Type = 0x0002: Account creation time.
    516516                         *
    517517                         * The time/date that the user originally registered for
     
    532532                         * Type = 0x0003: On-Since date.
    533533                         *
    534                          * The time/date that the user started their current 
     534                         * The time/date that the user started their current
    535535                         * session, stored in time_t format.
    536536                         */
     
    542542                         * Type = 0x0004: Idle time.
    543543                         *
    544                          * Number of minutes since the user actively used the 
     544                         * Number of minutes since the user actively used the
    545545                         * service.
    546546                         *
    547547                         * Note that the client tells the server when to start
    548                          * counting idle times, so this may or may not be 
     548                         * counting idle times, so this may or may not be
    549549                         * related to reality.
    550550                         */
     
    554554                } else if (type == 0x0005) {
    555555                        /*
    556                          * Type = 0x0005: Member since date. 
     556                         * Type = 0x0005: Member since date.
    557557                         *
    558558                         * The time/date that the user originally registered for
     
    570570                         * Type = 0x0006: ICQ Online Status
    571571                         *
    572                          * ICQ's Away/DND/etc "enriched" status. Some decoding 
     572                         * ICQ's Away/DND/etc "enriched" status. Some decoding
    573573                         * of values done by Scott <darkagl@pcnet.com>
    574574                         */
     
    595595
    596596                } else if (type == 0x000c) {
    597                         /* 
     597                        /*
    598598                         * Type = 0x000c
    599599                         *
     
    603603                         * Format is:
    604604                         * 4 bytes - Our IP address, 0xc0 a8 01 2b for 192.168.1.43
    605                          * 
     605                         *
    606606                         *
    607607                         */
     
    632632                         * Type = 0x0010: Session Length. (AOL)
    633633                         *
    634                          * The duration, in seconds, of the user's current 
     634                         * The duration, in seconds, of the user's current
    635635                         * session.
    636636                         *
     
    646646                         * Type = 0x0019
    647647                         *
    648                          * OSCAR short capability information.  A shortened 
     648                         * OSCAR short capability information.  A shortened
    649649                         * form of the normal capabilities.
    650650                         */
     
    656656                         * Type = 0x001a
    657657                         *
    658                          * AOL short capability information.  A shortened 
     658                         * AOL short capability information.  A shortened
    659659                         * form of the normal capabilities.
    660660                         */
     
    673673                         * Buddy icon information and available messages.
    674674                         *
    675                          * This almost seems like the AIM protocol guys gave 
    676                          * the iChat guys a Type, and the iChat guys tried to 
    677                          * cram as much cool shit into it as possible.  Then 
    678                          * the Windows AIM guys were like, "hey, that's 
     675                         * This almost seems like the AIM protocol guys gave
     676                         * the iChat guys a Type, and the iChat guys tried to
     677                         * cram as much cool shit into it as possible.  Then
     678                         * the Windows AIM guys were like, "hey, that's
    679679                         * pretty neat, let's copy those prawns."
    680680                         *
    681                          * In that spirit, this can contain a custom message, 
    682                          * kind of like an away message, but you're not away 
    683                          * (it's called an "available" message).  Or it can 
    684                          * contain information about the buddy icon the user 
     681                         * In that spirit, this can contain a custom message,
     682                         * kind of like an away message, but you're not away
     683                         * (it's called an "available" message).  Or it can
     684                         * contain information about the buddy icon the user
    685685                         * has stored on the server.
    686686                         */
     
    748748                        /*
    749749                         * Reaching here indicates that either AOL has
    750                          * added yet another TLV for us to deal with, 
     750                         * added yet another TLV for us to deal with,
    751751                         * or the parsing has gone Terribly Wrong.
    752752                         *
     
    805805        if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES)
    806806                aim_tlvlist_add_caps(&tlvlist, 0x000d, info->capabilities);
    807  
     807
    808808        if (info->present & AIM_USERINFO_PRESENT_SESSIONLEN)
    809809                aim_tlvlist_add_32(&tlvlist, (fu16_t)((info->flags & AIM_FLAG_AOL) ? 0x0010 : 0x000f), info->sessionlen);
     
    846846
    847847        /*
    848          * Remove this screen name from our queue.  If the client requested 
    849          * this buddy's info explicitly, then notify them that we do not have 
     848         * Remove this screen name from our queue.  If the client requested
     849         * this buddy's info explicitly, then notify them that we do not have
    850850         * info for this buddy.
    851851         */
     
    915915 * away are set, respectively, and their value may or may not be
    916916 * restricted to a few choices.  I am currently aware of:
    917  * 
     917 *
    918918 * us-ascii             Just that
    919919 * unicode-2-0          UCS2-BE
    920  * 
     920 *
    921921 * profile_len and awaymsg_len MUST be set similarly, and they MUST
    922922 * be the length of their respective strings in bytes.
     
    925925 * message, set awaymsg non-NULL and awaymsg_len to 0 (this is the
    926926 * obvious equivalent).
    927  * 
     927 *
    928928 */
    929929faim_export int aim_locate_setprofile(aim_session_t *sess,
     
    10481048
    10491049        snacid = aim_cachesnac(sess, 0x0002, 0x0005, 0x0000, NULL, 0);
    1050        
     1050
    10511051        aim_putsnac(&fr->data, 0x0002, 0x0005, 0x0000, snacid);
    10521052        aimbs_put16(&fr->data, infotype);
     
    11041104
    11051105        /*
    1106          * Remove this screen name from our queue.  If the client requested 
    1107          * this buddy's info explicitly, then notify them that we have info 
     1106         * Remove this screen name from our queue.  If the client requested
     1107         * this buddy's info explicitly, then notify them that we have info
    11081108         * for this buddy.
    11091109         */
     
    11161116}
    11171117
    1118 /* 
     1118/*
    11191119 * Subtype 0x0009 - Set directory profile data.
    11201120 *
     
    11231123 *
    11241124 */
    1125 faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy) 
     1125faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy)
    11261126{
    11271127        aim_conn_t *conn;
     
    11891189
    11901190        snacid = aim_cachesnac(sess, 0x0002, 0x000b, 0x0000, NULL, 0);
    1191        
     1191
    11921192        aim_putsnac(&fr->data, 0x0002, 0x000b, 0x0000, snacid);
    11931193        aimbs_put8(&fr->data, strlen(sn));
     
    12011201/*
    12021202 * Subtype 0x000f
    1203  * 
     1203 *
    12041204 * XXX pass these in better
    12051205 *
     
    12441244
    12451245/*
    1246  * Subtype 0x0015 - Request the info a user using the short method.  This is 
     1246 * Subtype 0x0015 - Request the info a user using the short method.  This is
    12471247 * what iChat uses.  It normally is VERY leniently rate limited.
    12481248 *
Note: See TracChangeset for help on using the changeset viewer.