comparison libpurple/protocols/oscar/oscar.h @ 27161:7054f810b0f9

Check in code that connects to oscar using clientLogin. This is the authentication scheme they've publically documented. We still use the old MD5-style login as the default, but you can optionally try this out by checking a check box on the advanced tab of your oscar account. Functionally everything is supposed to be the same. However, for some reason users with Mobile IM forwarding turned on don't show up online and can't be messaged. Not sure why. Using clientLogin DOES make it easier for AOL to track us. And yes, it probably makes it easier for AOL to block us, too. But I don't believe they want to do that. I believe they're trying to keep their network open, and I think we should appreciate that and try to work with them. We're not just some small open source project that slips under the radar unnoticed anymore. It's good to have options, right? None of this code was taken from anywhere (outside of libpurple). I wrote it all from scratch (and took a few bits from other places in libpurple). I did use the documentation on http://dev.aol.com/aim , but I don't believe that affects us from a licensing standpoint in any way. If you disagree we should talk about it on the devel mailing list.
author Mark Doliner <mark@kingant.net>
date Tue, 23 Jun 2009 18:20:12 +0000
parents 99e3f40d082f
children 4f24d5da4cb3
comparison
equal deleted inserted replaced
27160:763247959e00 27161:7054f810b0f9
467 * AIM Session: The main client-data interface. 467 * AIM Session: The main client-data interface.
468 * 468 *
469 */ 469 */
470 struct _OscarData 470 struct _OscarData
471 { 471 {
472 /** Only used when connecting with clientLogin */
473 PurpleUtilFetchUrlData *url_data;
474
472 gboolean iconconnecting; 475 gboolean iconconnecting;
473 gboolean set_icon; 476 gboolean set_icon;
474 477
475 GSList *create_rooms; 478 GSList *create_rooms;
476 479
520 * need to know about them. 523 * need to know about them.
521 */ 524 */
522 525
523 IcbmCookie *msgcookies; 526 IcbmCookie *msgcookies;
524 struct aim_icq_info *icq_info; 527 struct aim_icq_info *icq_info;
528
529 /** Only used when connecting with the old-style BUCP login. */
525 struct aim_authresp_info *authinfo; 530 struct aim_authresp_info *authinfo;
526 struct aim_emailinfo *emailinfo; 531 struct aim_emailinfo *emailinfo;
527 532
528 struct { 533 struct {
529 struct aim_userinfo_s *userinfo; 534 struct aim_userinfo_s *userinfo;
545 /** Contains pointers to handler functions for each family/subtype. */ 550 /** Contains pointers to handler functions for each family/subtype. */
546 GHashTable *handlerlist; 551 GHashTable *handlerlist;
547 552
548 /** A linked list containing FlapConnections. */ 553 /** A linked list containing FlapConnections. */
549 GSList *oscar_connections; 554 GSList *oscar_connections;
555 guint16 default_port;
550 556
551 /** A linked list containing PeerConnections. */ 557 /** A linked list containing PeerConnections. */
552 GSList *peer_connections; 558 GSList *peer_connections;
553 }; 559 };
554 560
566 #define AIM_ICQ_STATE_DIRECTDISABLED 0x00100000 572 #define AIM_ICQ_STATE_DIRECTDISABLED 0x00100000
567 #define AIM_ICQ_STATE_ICQHOMEPAGE 0x00200000 573 #define AIM_ICQ_STATE_ICQHOMEPAGE 0x00200000
568 #define AIM_ICQ_STATE_DIRECTREQUIREAUTH 0x10000000 574 #define AIM_ICQ_STATE_DIRECTREQUIREAUTH 0x10000000
569 #define AIM_ICQ_STATE_DIRECTCONTACTLIST 0x20000000 575 #define AIM_ICQ_STATE_DIRECTCONTACTLIST 0x20000000
570 576
571 typedef int (*aim_rxcallback_t)(OscarData *od, FlapConnection *conn, FlapFrame *frame, ...); 577 /**
572 578 * Only used when connecting with the old-style BUCP login.
573 579 */
574 /* family_auth.c */
575 struct aim_clientrelease 580 struct aim_clientrelease
576 { 581 {
577 char *name; 582 char *name;
578 guint32 build; 583 guint32 build;
579 char *url; 584 char *url;
580 char *info; 585 char *info;
581 }; 586 };
582 587
588 /**
589 * Only used when connecting with the old-style BUCP login.
590 */
583 struct aim_authresp_info 591 struct aim_authresp_info
584 { 592 {
585 char *bn; 593 char *bn;
586 guint16 errorcode; 594 guint16 errorcode;
587 char *errorurl; 595 char *errorurl;
609 const char *room; 617 const char *room;
610 guint16 instance; 618 guint16 instance;
611 } chat; 619 } chat;
612 }; 620 };
613 621
622 int oscar_connect_to_bos(PurpleConnection *gc, OscarData *od, const char *host, guint16 port, guint8 *cookie, guint16 cookielen);
623
624 /* family_auth.c */
625
626 /**
627 * Only used when connecting with the old-style BUCP login.
628 */
614 int aim_request_login(OscarData *od, FlapConnection *conn, const char *bn); 629 int aim_request_login(OscarData *od, FlapConnection *conn, const char *bn);
630
631 /**
632 * Only used when connecting with the old-style BUCP login.
633 */
615 int aim_send_login(OscarData *od, FlapConnection *conn, const char *bn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key, gboolean allow_multiple_logins); 634 int aim_send_login(OscarData *od, FlapConnection *conn, const char *bn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key, gboolean allow_multiple_logins);
635
636 /**
637 * Only used when connecting with the old-style BUCP login.
638 */
616 /* 0x000b */ int aim_auth_securid_send(OscarData *od, const char *securid); 639 /* 0x000b */ int aim_auth_securid_send(OscarData *od, const char *securid);
617 640
618 void oscar_data_addhandler(OscarData *od, guint16 family, guint16 subtype, aim_rxcallback_t newhandler, guint16 flags); 641 /**
619 aim_rxcallback_t aim_callhandler(OscarData *od, guint16 family, guint16 subtype); 642 * Only used when connecting with clientLogin.
643 */
644 void send_client_login(OscarData *od, const char *username);
620 645
621 /* flap_connection.c */ 646 /* flap_connection.c */
622 FlapConnection *flap_connection_new(OscarData *, int type); 647 FlapConnection *flap_connection_new(OscarData *, int type);
623 void flap_connection_close(OscarData *od, FlapConnection *conn); 648 void flap_connection_close(OscarData *od, FlapConnection *conn);
624 void flap_connection_destroy(FlapConnection *conn, OscarDisconnectReason reason, const gchar *error_message); 649 void flap_connection_destroy(FlapConnection *conn, OscarDisconnectReason reason, const gchar *error_message);
630 void flap_connection_recv_cb_ssl(gpointer data, PurpleSslConnection *gsc, PurpleInputCondition cond); 655 void flap_connection_recv_cb_ssl(gpointer data, PurpleSslConnection *gsc, PurpleInputCondition cond);
631 656
632 void flap_connection_send(FlapConnection *conn, FlapFrame *frame); 657 void flap_connection_send(FlapConnection *conn, FlapFrame *frame);
633 void flap_connection_send_version(OscarData *od, FlapConnection *conn); 658 void flap_connection_send_version(OscarData *od, FlapConnection *conn);
634 void flap_connection_send_version_with_cookie(OscarData *od, FlapConnection *conn, guint16 length, const guint8 *chipsahoy); 659 void flap_connection_send_version_with_cookie(OscarData *od, FlapConnection *conn, guint16 length, const guint8 *chipsahoy);
660 void flap_connection_send_version_with_cookie_and_clientinfo(OscarData *od, FlapConnection *conn, guint16 length, const guint8 *chipsahoy, ClientInfo *ci);
635 void flap_connection_send_snac(OscarData *od, FlapConnection *conn, guint16 family, const guint16 subtype, guint16 flags, aim_snacid_t snacid, ByteStream *data); 661 void flap_connection_send_snac(OscarData *od, FlapConnection *conn, guint16 family, const guint16 subtype, guint16 flags, aim_snacid_t snacid, ByteStream *data);
636 void flap_connection_send_snac_with_priority(OscarData *od, FlapConnection *conn, guint16 family, const guint16 subtype, guint16 flags, aim_snacid_t snacid, ByteStream *data, gboolean high_priority); 662 void flap_connection_send_snac_with_priority(OscarData *od, FlapConnection *conn, guint16 family, const guint16 subtype, guint16 flags, aim_snacid_t snacid, ByteStream *data, gboolean high_priority);
637 void flap_connection_send_keepalive(OscarData *od, FlapConnection *conn); 663 void flap_connection_send_keepalive(OscarData *od, FlapConnection *conn);
638 FlapFrame *flap_frame_new(OscarData *od, guint16 channel, int datalen); 664 FlapFrame *flap_frame_new(OscarData *od, guint16 channel, int datalen);
639 665
666 /* oscar_data.c */
667 typedef int (*aim_rxcallback_t)(OscarData *od, FlapConnection *conn, FlapFrame *frame, ...);
668
640 OscarData *oscar_data_new(void); 669 OscarData *oscar_data_new(void);
641 void oscar_data_destroy(OscarData *); 670 void oscar_data_destroy(OscarData *);
671 void oscar_data_addhandler(OscarData *od, guint16 family, guint16 subtype, aim_rxcallback_t newhandler, guint16 flags);
672 aim_rxcallback_t aim_callhandler(OscarData *od, guint16 family, guint16 subtype);
642 673
643 /* misc.c */ 674 /* misc.c */
644 #define AIM_VISIBILITYCHANGE_PERMITADD 0x05 675 #define AIM_VISIBILITYCHANGE_PERMITADD 0x05
645 #define AIM_VISIBILITYCHANGE_PERMITREMOVE 0x06 676 #define AIM_VISIBILITYCHANGE_PERMITREMOVE 0x06
646 #define AIM_VISIBILITYCHANGE_DENYADD 0x07 677 #define AIM_VISIBILITYCHANGE_DENYADD 0x07