Ignore:
Timestamp:
2010-07-24T13:29:48Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
03f3828
Parents:
938c305 (diff), c495217 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging libyahoo2 fixes. Now completely up-to-date with libyahoo2 svn
again, should try to keep it up a little bit better and submit my fixes
upstream.

This also adds code for Yahoo! file transfers but BitlBee isn't using it
yet. (It doesn't seem to support flow control which makes this complicated.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/yahoo2.h

    r938c305 rc8791f2  
    5151#include "yahoo2_types.h"
    5252
    53 /* returns the socket descriptor for a given pager connection. shouldn't be needed */
    54 int  yahoo_get_fd(int id);
     53/* returns the socket descriptor object for a given pager connection. shouldn't be needed */
     54        void *yahoo_get_fd(int id);
    5555
    5656/* says how much logging to do */
    5757/* see yahoo2_types.h for the different values */
    58 int yahoo_set_log_level(enum yahoo_log_level level);
    59 enum yahoo_log_level  yahoo_get_log_level( void );
     58        int yahoo_set_log_level(enum yahoo_log_level level);
     59        enum yahoo_log_level yahoo_get_log_level(void);
    6060
    6161/* these functions should be self explanatory */
    6262/* who always means the buddy you're acting on */
    6363/* id is the successful value returned by yahoo_init */
    64 
    6564
    6665/* init returns a connection id used to identify the connection hereon */
     
    8887 * You should set at least local_host if you intend to use webcams
    8988 */
    90 int  yahoo_init_with_attributes(const char *username, const char *password, ...);
     89        int yahoo_init_with_attributes(const char *username,
     90                const char *password, ...);
    9191
    9292/* yahoo_init does the same as yahoo_init_with_attributes, assuming defaults
    9393 * for all attributes */
    94 int  yahoo_init(const char *username, const char *password);
    95 
    96 
     94        int yahoo_init(const char *username, const char *password);
    9795
    9896/* release all resources held by this session */
    9997/* you need to call yahoo_close for a session only if
    10098 * yahoo_logoff is never called for it (ie, it was never logged in) */
    101 void yahoo_close(int id);
     99        void yahoo_close(int id);
    102100/* login logs in to the server */
    103101/* initial is of type enum yahoo_status.  see yahoo2_types.h */
    104 void yahoo_login(int id, int initial);
    105 void yahoo_logoff(int id);
     102        void yahoo_login(int id, int initial);
     103        void yahoo_logoff(int id);
    106104/* reloads status of all buddies */
    107 void yahoo_refresh(int id);
     105        void yahoo_refresh(int id);
    108106/* activates/deactivates an identity */
    109 void yahoo_set_identity_status(int id, const char * identity, int active);
     107        void yahoo_set_identity_status(int id, const char *identity,
     108                int active);
    110109/* regets the entire buddy list from the server */
    111 void yahoo_get_list(int id);
     110        void yahoo_get_list(int id);
    112111/* download buddy contact information from your yahoo addressbook */
    113 void yahoo_get_yab(int id);
     112        void yahoo_get_yab(int id);
    114113/* add/modify an address book entry.  if yab->dbid is set, it will */
    115114/* modify that entry else it creates a new entry */
    116 void yahoo_set_yab(int id, struct yab * yab);
    117 void yahoo_keepalive(int id);
    118 void yahoo_chat_keepalive(int id);
     115        void yahoo_set_yab(int id, struct yab *yab);
     116        void yahoo_keepalive(int id);
     117        void yahoo_chat_keepalive(int id);
    119118
    120119/* from is the identity you're sending from.  if NULL, the default is used */
    121120/* utf8 is whether msg is a utf8 string or not. */
    122 void yahoo_send_im(int id, const char *from, const char *who, const char *msg, int utf8, int picture);
     121        void yahoo_send_im(int id, const char *from, const char *who,
     122                const char *msg, int utf8, int picture);
     123        void yahoo_send_buzz(int id, const char *from, const char *who);
    123124/* if type is true, send typing notice, else send stopped typing notice */
    124 void yahoo_send_typing(int id, const char *from, const char *who, int typ);
     125        void yahoo_send_typing(int id, const char *from, const char *who,
     126                int typ);
    125127
    126128/* used to set away/back status. */
    127129/* away says whether the custom message is an away message or a sig */
    128 void yahoo_set_away(int id, enum yahoo_status state, const char *msg, int away);
    129 
    130 void yahoo_add_buddy(int id, const char *who, const char *group, const char *msg);
    131 void yahoo_remove_buddy(int id, const char *who, const char *group);
    132 void yahoo_reject_buddy(int id, const char *who, const char *msg);
    133 void yahoo_stealth_buddy(int id, const char *who, int unstealth);
     130        void yahoo_set_away(int id, enum yahoo_status state, const char *msg,
     131                int away);
     132
     133        void yahoo_add_buddy(int id, const char *who, const char *group,
     134                const char *msg);
     135        void yahoo_remove_buddy(int id, const char *who, const char *group);
     136        void yahoo_confirm_buddy(int id, const char *who, int reject,
     137                const char *msg);
     138        void yahoo_stealth_buddy(int id, const char *who, int unstealth);
    134139/* if unignore is true, unignore, else ignore */
    135 void yahoo_ignore_buddy(int id, const char *who, int unignore);
    136 void yahoo_change_buddy_group(int id, const char *who, const char *old_group, const char *new_group);
    137 void yahoo_group_rename(int id, const char *old_group, const char *new_group);
    138 
    139 void yahoo_conference_invite(int id, const char * from, YList *who, const char *room, const char *msg);
    140 void yahoo_conference_addinvite(int id, const char * from, const char *who, const char *room, const YList * members, const char *msg);
    141 void yahoo_conference_decline(int id, const char * from, YList *who, const char *room, const char *msg);
    142 void yahoo_conference_message(int id, const char * from, YList *who, const char *room, const char *msg, int utf8);
    143 void yahoo_conference_logon(int id, const char * from, YList *who, const char *room);
    144 void yahoo_conference_logoff(int id, const char * from, YList *who, const char *room);
     140        void yahoo_ignore_buddy(int id, const char *who, int unignore);
     141        void yahoo_change_buddy_group(int id, const char *who,
     142                const char *old_group, const char *new_group);
     143        void yahoo_group_rename(int id, const char *old_group,
     144                const char *new_group);
     145
     146        void yahoo_conference_invite(int id, const char *from, YList *who,
     147                const char *room, const char *msg);
     148        void yahoo_conference_addinvite(int id, const char *from,
     149                const char *who, const char *room, const YList *members,
     150                const char *msg);
     151        void yahoo_conference_decline(int id, const char *from, YList *who,
     152                const char *room, const char *msg);
     153        void yahoo_conference_message(int id, const char *from, YList *who,
     154                const char *room, const char *msg, int utf8);
     155        void yahoo_conference_logon(int id, const char *from, YList *who,
     156                const char *room);
     157        void yahoo_conference_logoff(int id, const char *from, YList *who,
     158                const char *room);
    145159
    146160/* Get a list of chatrooms */
    147 void yahoo_get_chatrooms(int id,int chatroomid);
     161        void yahoo_get_chatrooms(int id, int chatroomid);
    148162/* join room with specified roomname and roomid */
    149 void yahoo_chat_logon(int id, const char *from, const char *room, const char *roomid);
     163        void yahoo_chat_logon(int id, const char *from, const char *room,
     164                const char *roomid);
    150165/* Send message "msg" to room with specified roomname, msgtype is 1-normal message or 2-/me mesage */
    151 void yahoo_chat_message(int id, const char *from, const char *room, const char *msg, const int msgtype, const int utf8);
     166        void yahoo_chat_message(int id, const char *from, const char *room,
     167                const char *msg, const int msgtype, const int utf8);
    152168/* Log off chat */
    153 void yahoo_chat_logoff(int id, const char *from);
     169        void yahoo_chat_logoff(int id, const char *from);
    154170
    155171/* requests a webcam feed */
    156172/* who is the person who's webcam you would like to view */
    157173/* if who is null, then you're the broadcaster */
    158 void yahoo_webcam_get_feed(int id, const char *who);
    159 void yahoo_webcam_close_feed(int id, const char *who);
     174        void yahoo_webcam_get_feed(int id, const char *who);
     175        void yahoo_webcam_close_feed(int id, const char *who);
    160176
    161177/* sends an image when uploading */
     
    163179/* in bytes. The timestamp is the time in milliseconds since we started the */
    164180/* webcam. */
    165 void yahoo_webcam_send_image(int id, unsigned char *image, unsigned int length, unsigned int timestamp);
     181        void yahoo_webcam_send_image(int id, unsigned char *image,
     182                unsigned int length, unsigned int timestamp);
    166183
    167184/* this function should be called if we want to allow a user to watch the */
    168185/* webcam. Who is the user we want to accept. */
    169186/* Accept user (accept = 1), decline user (accept = 0) */
    170 void yahoo_webcam_accept_viewer(int id, const char* who, int accept);
     187        void yahoo_webcam_accept_viewer(int id, const char *who, int accept);
    171188
    172189/* send an invitation to a user to view your webcam */
    173 void yahoo_webcam_invite(int id, const char *who);
     190        void yahoo_webcam_invite(int id, const char *who);
    174191
    175192/* will set up a connection and initiate file transfer.
     
    177194 * the file data to
    178195 */
    179 void yahoo_send_file(int id, const char *who, const char *msg, const char *name, unsigned long size,
     196        void yahoo_send_file(int id, const char *who, const char *msg,
     197                const char *name, unsigned long size,
    180198                yahoo_get_fd_callback callback, void *data);
    181199
     200/*
     201 * Respond to a file transfer request. Be sure to provide the callback data
     202 * since that is your only chance to recognize future callbacks
     203 */
     204        void yahoo_send_file_transfer_response(int client_id, int response,
     205                char *id, void *data);
     206
     207
    182208/* send a search request
    183209 */
    184 void yahoo_search(int id, enum yahoo_search_type t, const char *text, enum yahoo_search_gender g, enum yahoo_search_agerange ar,
     210        void yahoo_search(int id, enum yahoo_search_type t, const char *text,
     211                enum yahoo_search_gender g, enum yahoo_search_agerange ar,
    185212                int photo, int yahoo_only);
    186213
     
    190217 * where the above three are passed to ext_yahoo_got_search_result
    191218 */
    192 void yahoo_search_again(int id, int start);
    193 
    194 /* returns a socket fd to a url for downloading a file. */
    195 void yahoo_get_url_handle(int id, const char *url,
    196                 yahoo_get_url_handle_callback callback, void *data);
     219        void yahoo_search_again(int id, int start);
    197220
    198221/* these should be called when input is available on a fd */
    199222/* registered by ext_yahoo_add_handler */
    200223/* if these return negative values, errno may be set */
    201 int  yahoo_read_ready(int id, int fd, void *data);
    202 int  yahoo_write_ready(int id, int fd, void *data);
     224        int yahoo_read_ready(int id, void *fd, void *data);
     225        int yahoo_write_ready(int id, void *fd, void *data);
    203226
    204227/* utility functions. these do not hit the server */
    205 enum yahoo_status yahoo_current_status(int id);
    206 const YList * yahoo_get_buddylist(int id);
    207 const YList * yahoo_get_ignorelist(int id);
    208 const YList * yahoo_get_identities(int id);
     228        enum yahoo_status yahoo_current_status(int id);
     229        const YList *yahoo_get_buddylist(int id);
     230        const YList *yahoo_get_ignorelist(int id);
     231        const YList *yahoo_get_identities(int id);
    209232/* 'which' could be y, t, c or login.  This may change in later versions. */
    210 const char  * yahoo_get_cookie(int id, const char *which);
     233        const char *yahoo_get_cookie(int id, const char *which);
    211234
    212235/* returns the url used to get user profiles - you must append the user id */
    213236/* as of now this is http://profiles.yahoo.com/ */
    214237/* You'll have to do urlencoding yourself, but see yahoo_httplib.h first */
    215 const char  * yahoo_get_profile_url( void );
    216 
    217 void yahoo_buddyicon_request(int id, const char *who);
    218 
    219 void yahoo_accept_buddy_ymsg13(int,const char*,const char*);
    220 void yahoo_reject_buddy_ymsg13(int,const char*,const char*,const char*);
     238        const char *yahoo_get_profile_url(void);
     239
     240        void yahoo_buddyicon_request(int id, const char *who);
    221241
    222242#include "yahoo_httplib.h"
     
    225245}
    226246#endif
    227 
    228247#endif
Note: See TracChangeset for help on using the changeset viewer.