Ignore:
Timestamp:
2007-04-16T04:31:52Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b3cae44
Parents:
6bbb939
Message:

Updating the Yahoo! module. This seems to fix handling of incoming away
states/messages, should fix some issues with group chats, and unfortunately
also adds some crap which I don't want to clean up for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/yahoo2_callbacks.h

    r6bbb939 rcfc8d58  
    2929 * declared in this file and defined in libyahoo2.c
    3030 */
    31 
    3231
    3332
     
    6766
    6867
    69 
    7068/*
    7169 * The following functions need to be implemented in the client
     
    9694 *      url  - url to reactivate account if locked
    9795 */
    98 void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response)(int id, int succ, char *url);
    99 
    100 
     96void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response)(int id, int succ, const char *url);
    10197
    10298
     
    111107
    112108
    113 
    114 
    115109/*
    116110 * Name: ext_yahoo_got_ignore
     
    123117
    124118
    125 
    126 
    127 
    128119/*
    129120 * Name: ext_yahoo_got_identities
     
    136127
    137128
    138 
    139 
    140 
    141129/*
    142130 * Name: ext_yahoo_got_cookies
     
    148136
    149137
     138/*
     139 * Name: ext_yahoo_got_ping
     140 *      Called when the ping packet is received from the server
     141 * Params:
     142 *      id   - the id that identifies the server connection
     143 *  errormsg - optional error message
     144 */
     145void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping)(int id, const char *errormsg);
    150146
    151147
     
    159155 *      msg  - the message if stat == YAHOO_STATUS_CUSTOM
    160156 *      away - whether the contact is away or not (YAHOO_STATUS_CUSTOM)
    161  *             for YAHOO_STATUS_IDLE, this is the number of seconds he is idle
    162  */
    163 void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed)(int id, char *who, int stat, char *msg, int away);
    164 
    165 
     157 *      idle - this is the number of seconds he is idle [if he is idle]
     158 *      mobile - this is set for mobile users/buddies
     159 *      TODO: add support for pager, chat, and game states
     160 */
     161void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed)(int id, const char *who, int stat, const char *msg, int away, int idle, int mobile);
    166162
    167163
     
    171167 * Params:
    172168 *      id   - the id that identifies the server connection
     169 *      me   - the identity the message was sent to
    173170 *      who  - the handle of the remote user
    174171 *      msg  - the message - NULL if stat == 2
     
    180177 *      utf8 - whether the message is encoded as utf8 or not
    181178 */
    182 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im)(int id, char *who, char *msg, long tm, int stat, int utf8);
    183 
    184 
     179void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im)(int id, const char *me, const char *who, const char *msg, long tm, int stat, int utf8);
    185180
    186181
     
    190185 * Params:
    191186 *      id   - the id that identifies the server connection
     187 *      me   - the identity the invitation was sent to
    192188 *      who  - the user inviting you
    193189 *      room - the room to join
     
    195191 *      members - the initial members of the conference (null terminated list)
    196192 */
    197 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite)(int id, char *who, char *room, char *msg, YList *members);
    198 
    199 
     193void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite)(int id, const char *me, const char *who, const char *room, const char *msg, YList *members);
    200194
    201195
     
    205199 * Params:
    206200 *      id   - the id that identifies the server connection
     201 *      me   - the identity in the conference
    207202 *      who  - the user who has declined
    208203 *      room - the room
    209204 *      msg  - the declining message
    210205 */
    211 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline)(int id, char *who, char *room, char *msg);
    212 
    213 
     206void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline)(int id, const char *me, const char *who, const char *room, const char *msg);
    214207
    215208
     
    219212 * Params:
    220213 *      id   - the id that identifies the server connection
     214 *      me   - the identity in the conference
    221215 *      who  - the user who has joined
    222216 *      room - the room joined
    223217 */
    224 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin)(int id, char *who, char *room);
    225 
    226 
     218void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin)(int id, const char *me, const char *who, const char *room);
    227219
    228220
     
    232224 * Params:
    233225 *      id   - the id that identifies the server connection
     226 *      me   - the identity in the conference
    234227 *      who  - the user who has left
    235228 *      room - the room left
    236229 */
    237 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave)(int id, char *who, char *room);
    238 
    239 
    240 
    241 
     230void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave)(int id, const char *me, const char *who, const char *room);
    242231
    243232
    244233/*
    245234 * Name: ext_yahoo_chat_cat_xml
    246  *      Called when joining the chatroom.
     235 *      Called when ?
    247236 * Params:
    248237 *      id      - the id that identifies the server connection
    249  *      room    - the room joined, used in all other chat calls, freed by
    250  *                library after call
    251  *      topic   - the topic of the room, freed by library after call
    252  *      members - the initial members of the chatroom (null terminated YList of
    253  *                yahoo_chat_member's) Must be freed by the client
    254  */
    255 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, char *xml);
    256 
    257 
    258 
    259 
    260 
     238 *      xml     - ?
     239 */
     240void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, const char *xml);
    261241
    262242
     
    266246 * Params:
    267247 *      id      - the id that identifies the server connection
     248 *      me   - the identity in the chatroom
    268249 *      room    - the room joined, used in all other chat calls, freed by
    269250 *                library after call
     
    273254 *      fd      - the socket where the connection is coming from (for tracking)
    274255 */
    275 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join)(int id, char *room, char *topic, YList *members, int fd);
    276 
    277 
    278 
    279 
     256void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join)(int id, const char *me, const char *room, const char *topic, YList *members, int fd);
    280257
    281258
     
    285262 * Params:
    286263 *      id   - the id that identifies the server connection
     264 *      me   - the identity in the chatroom
    287265 *      room - the room joined
    288266 *      who  - the user who has joined, Must be freed by the client
    289267 */
    290 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin)(int id, char *room, struct yahoo_chat_member *who);
    291 
    292 
     268void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin)(int id, const char *me, const char *room, struct yahoo_chat_member *who);
    293269
    294270
     
    298274 * Params:
    299275 *      id   - the id that identifies the server connection
     276 *      me   - the identity in the chatroom
    300277 *      room - the room left
    301278 *      who  - the user who has left (Just the User ID)
    302279 */
    303 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave)(int id, char *room, char *who);
    304 
    305 
     280void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave)(int id, const char *me, const char *room, const char *who);
    306281
    307282
     
    311286 * Params:
    312287 *      id   - the id that identifies the server connection
     288 *      me   - the identity in the chatroom
    313289 *      room - the room
    314290 *      who  - the user who messaged (Just the user id)
     
    318294 *      utf8 - whether the message is utf8 encoded or not
    319295 */
    320 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message)(int id, char *who, char *room, char *msg, int msgtype, int utf8);
     296void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message)(int id, const char *me, const char *who, const char *room, const char *msg, int msgtype, int utf8);
     297
    321298
    322299/*
     
    329306 * Params:
    330307 *      id   - the id that identifies this connection
     308 *      me   - the identity in the chatroom
    331309 * Returns:
    332310 *      nothing.
    333311 */
    334 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout)(int id);
     312void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout)(int id, const char *me);
     313
    335314
    336315/*
     
    344323 * Params:
    345324 *      id   - the id that identifies this connection
     325 *      me   - the identity in the chatroom
    346326 * Returns:
    347327 *      nothing.
    348328 */
    349 
    350 void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror)(int id);
     329void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror)(int id, const char *me);
     330
    351331
    352332/*
     
    355335 * Params:
    356336 *      id   - the id that identifies the server connection
     337 *      me   - the identity the conf message was sent to
    357338 *      who  - the user who messaged
    358339 *      room - the room
     
    360341 *      utf8 - whether the message is utf8 encoded or not
    361342 */
    362 void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message)(int id, char *who, char *room, char *msg, int utf8);
    363 
    364 
     343void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message)(int id, const char *me, const char *who, const char *room, const char *msg, int utf8);
    365344
    366345
     
    370349 * Params:
    371350 *      id   - the id that identifies the server connection
     351 *      me   - the identity the file was sent to
    372352 *      who  - the user who sent the file
    373353 *      url  - the file url
     
    377357 *      fsize- the file size if direct transfer
    378358 */
    379 void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file)(int id, char *who, char *url, long expires, char *msg, char *fname, unsigned long fesize);
    380 
    381 
     359void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file)(int id, const char *me, const char *who, const char *url, long expires, const char *msg, const char *fname, unsigned long fesize);
    382360
    383361
     
    391369 *      msg  - any message sent
    392370 */
    393 void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added)(int id, char *myid, char *who, char *msg);
    394 
    395 
     371void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added)(int id, const char *myid, const char *who, const char *msg);
    396372
    397373
     
    404380 *      msg  - any message sent
    405381 */
    406 void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected)(int id, char *who, char *msg);
    407 
    408 
     382void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected)(int id, const char *who, const char *msg);
    409383
    410384
     
    414388 * Params:
    415389 *      id   - the id that identifies the server connection
     390 *      me   - the handle of the identity the notification is sent to
    416391 *      who  - the handle of the remote user
    417392 *      stat - 1 if typing, 0 if stopped typing
    418393 */
    419 void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify)(int id, char *who, int stat);
    420 
    421 
     394void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify)(int id, const char *me, const char *who, int stat);
    422395
    423396
     
    427400 * Params:
    428401 *      id   - the id that identifies the server connection
     402 *      me   - the handle of the identity the notification is sent to
    429403 *      who  - the handle of the remote user
    430404 *      stat - 1 if game, 0 if stopped gaming
    431405 */
    432 void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify)(int id, char *who, int stat);
    433 
    434 
     406void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify)(int id, const char *me, const char *who, int stat);
    435407
    436408
     
    444416 *      cnt  - mail count - 0 if new mail notification
    445417 */
    446 void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify)(int id, char *from, char *subj, int cnt);
    447 
    448 
     418void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify)(int id, const char *from, const char *subj, int cnt);
    449419
    450420
     
    456426 *      msg  - the message
    457427 */
    458 void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message)(int id, char *msg);
    459 
    460 
    461 
    462 
    463 
    464 
    465 
    466 
    467 
    468 
     428void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message)(int id, const char *msg);
     429
     430/*
     431 * Name: ext_yahoo_got_buddyicon
     432 *      Buddy icon received
     433 * Params:
     434 *      id - the id that identifies the server connection
     435 *      me - the handle of the identity the notification is sent to
     436 *      who - the person the buddy icon is for
     437 *      url - the url to use to load the icon
     438 *      checksum - the checksum of the icon content
     439 */
     440void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon)(int id, const char *me, const char *who, const char *url, int checksum);
     441
     442/*
     443 * Name: ext_yahoo_got_buddyicon_checksum
     444 *      Buddy icon checksum received
     445 * Params:
     446 *      id - the id that identifies the server connection
     447 *      me - the handle of the identity the notification is sent to
     448 *      who - the yahoo id of the buddy icon checksum is for
     449 *      checksum - the checksum of the icon content
     450 */
     451void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum)(int id, const char *me,const char *who, int checksum);
     452
     453/*
     454 * Name: ext_yahoo_got_buddyicon_request
     455 *      Buddy icon request received
     456 * Params:
     457 *      id - the id that identifies the server connection
     458 *      me - the handle of the identity the notification is sent to
     459 *      who - the yahoo id of the buddy that requested the buddy icon
     460 */
     461void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request)(int id, const char *me, const char *who);
     462
     463/*
     464 * Name: ext_yahoo_got_buddyicon_request
     465 *      Buddy icon request received
     466 * Params:
     467 *      id - the id that identifies the server connection
     468 *      url - remote url, the uploaded buddy icon can be fetched from
     469 */
     470void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded)(int id, const char *url);
    469471
    470472/*
     
    496498
    497499
    498 
    499 
    500500/*
    501501 * Name: ext_yahoo_webcam_invite
     
    503503 * Params:
    504504 *      id   - the id that identifies the server connection
     505 *      me   - identity the invitation is to
    505506 *      from - who the invitation is from
    506507 */
    507 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite)(int id, char *from);
    508 
    509 
     508void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite)(int id, const char *me, const char *from);
    510509
    511510
     
    515514 * Params:
    516515 *      id   - the id that identifies the server connection
     516 *      me   - identity the invitation response is to
    517517 *      from - who the invitation response is from
    518518 *      accept - 0 (decline), 1 (accept)
    519519 */
    520 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply)(int id, char *from, int accept);
    521 
     520void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply)(int id, const char *me, const char *from, int accept);
    522521
    523522
     
    534533 *               4 = user does not have webcam online
    535534 */
    536 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed)(int id, char *who, int reason);
     535void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed)(int id, const char *who, int reason);
    537536
    538537
     
    552551
    553552
    554 
    555553/*
    556554 * Name: ext_yahoo_error
     
    560558 *      err  - the error message
    561559 *      fatal- whether this error is fatal to the connection or not
    562  */
    563 void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, char *err, int fatal);
    564 
    565 
     560 *      num  - Which error is this
     561 */
     562void YAHOO_CALLBACK_TYPE(ext_yahoo_error)(int id, const char *err, int fatal, int num);
    566563
    567564
     
    574571 *      connect - 0=disconnect 1=connect 2=request
    575572 */
    576 void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer)(int id, char *who, int connect);
    577 
    578 
     573void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer)(int id, const char *who, int connect);
    579574
    580575
     
    587582 */
    588583void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request)(int id, int send);
    589 
    590 
    591584
    592585
     
    599592 *      0
    600593 */
    601 int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(char *fmt, ...);
    602 
    603 
    604 
    605 
    606 
    607 
     594int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(const char *fmt, ...);
    608595
    609596
     
    624611
    625612
    626 
    627 
    628613/*
    629614 * Name: ext_yahoo_remove_handler
     
    634619 */
    635620void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler)(int id, int tag);
    636 
    637 
    638 
    639621
    640622
     
    648630 *      a unix file descriptor to the socket
    649631 */
    650 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect)(char *host, int port);
    651 
    652 
    653 
    654 
    655 
    656 
     632int YAHOO_CALLBACK_TYPE(ext_yahoo_connect)(const char *host, int port);
    657633
    658634
     
    675651 *      a unix file descriptor to the socket
    676652 */
    677 int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async)(int id, char *host, int port,
     653int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async)(int id, const char *host, int port,
    678654                yahoo_connect_callback callback, void *callback_data);
    679655
     
    686662 */
    687663void yahoo_register_callbacks(struct yahoo_callbacks * tyc);
    688        
     664
    689665#undef YAHOO_CALLBACK_TYPE
    690666
     
    696672
    697673#endif
     674
Note: See TracChangeset for help on using the changeset viewer.