Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.h

    r27053b5 r8b01217  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2010 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2004 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    3939#endif
    4040
    41 /* This should be MSN Messenger 7.0.0813
    42 #define MSNP11_PROD_KEY "CFHUR$52U_{VIX5T"
    43 #define MSNP11_PROD_ID  "PROD0101{0RM?UBW"
    44 */
    45 
    46 #define MSN_NS_HOST "messenger.hotmail.com"
    47 #define MSN_NS_PORT 1863
    48 
    49 /* Some other version.
    50 #define MSNP11_PROD_KEY "O4BG@C7BWLYQX?5G"
    51 #define MSNP11_PROD_ID  "PROD01065C%ZFN6F"
    52 */
    53 
    54 #define MSNP11_PROD_KEY "ILTXC!4IXB5FB*PX"
    55 #define MSNP11_PROD_ID  "PROD0119GSJUC$18"
    56 #define MSNP_VER        "MSNP15"
    57 #define MSNP_BUILD      "8.5.1288"
     41#define QRY_NAME "msmsgs@msnmsgr.com"
     42#define QRY_CODE "Q1P7W2E4J9R8U3S5"
    5843
    5944#define MSN_SB_NEW         -24062002
     
    7661#define PROFILE_URL "http://members.msn.com/"
    7762
    78 typedef enum
    79 {
    80         MSN_GOT_PROFILE = 1,
    81         MSN_GOT_PROFILE_DN = 2,
    82         MSN_DONE_ADL = 4,
    83         MSN_REAUTHING = 8,
    84 } msn_flags_t;
    85 
    86 struct msn_handler_data
    87 {
    88         int fd, inpa;
    89         int rxlen;
    90         char *rxq;
    91        
    92         int msglen;
    93         char *cmd_text;
    94        
    95         /* Either ic or sb */
    96         gpointer data;
    97        
    98         int (*exec_command) ( struct msn_handler_data *handler, char **cmd, int count );
    99         int (*exec_message) ( struct msn_handler_data *handler, char *msg, int msglen, char **cmd, int count );
    100 };
    101 
    10263struct msn_data
    10364{
    10465        struct im_connection *ic;
    10566       
    106         struct msn_handler_data ns[1];
    107         msn_flags_t flags;
     67        int fd;
     68        struct msn_handler_data *handler;
    10869       
    10970        int trId;
    110         char *tokens[4];
    111         char *lock_key, *pp_policy;
    112        
    113         GSList *msgq, *grpq, *soapq;
     71       
     72        GSList *msgq, *grpq;
    11473        GSList *switchboards;
    11574        int sb_failures;
    11675        time_t first_sb_failure;
     76        GSList *filetransfers;
    11777       
    11878        const struct msn_away_state *away_state;
    119         GSList *groups;
    120        
    121         /* Mostly used for sending the ADL command; since MSNP13 the client
    122            is responsible for downloading the contact list and then sending
    123            it to the MSNP server. */
    124         GTree *domaintree;
    125         int adl_todo;
     79        int buddycount;
     80        int groupcount;
     81        char **grouplist;
    12682};
    12783
     
    13086        struct im_connection *ic;
    13187       
    132         /* The following two are also in the handler. TODO: Clean up. */
    13388        int fd;
    13489        gint inp;
     
    172127};
    173128
    174 typedef enum
    175 {
    176         MSN_BUDDY_FL = 1,   /* Warning: FL,AL,BL *must* be 1,2,4. */
    177         MSN_BUDDY_AL = 2,
    178         MSN_BUDDY_BL = 4,
    179         MSN_BUDDY_RL = 8,
    180         MSN_BUDDY_PL = 16,
    181         MSN_BUDDY_ADL_SYNCED = 256,
    182 } msn_buddy_flags_t;
    183 
    184 struct msn_buddy_data
    185 {
    186         char *cid;
    187         msn_buddy_flags_t flags;
    188 };
    189 
    190 struct msn_group
    191 {
    192         char *name;
    193         char *id;
     129struct msn_handler_data
     130{
     131        int fd;
     132        int rxlen;
     133        char *rxq;
     134       
     135        int msglen;
     136        char *cmd_text;
     137       
     138        gpointer data;
     139       
     140        int (*exec_command) ( gpointer data, char **cmd, int count );
     141        int (*exec_message) ( gpointer data, char *msg, int msglen, char **cmd, int count );
    194142};
    195143
     
    213161
    214162/* ns.c */
    215 int msn_ns_write( struct im_connection *ic, int fd, const char *fmt, ... );
    216 gboolean msn_ns_connect( struct im_connection *ic, struct msn_handler_data *handler, const char *host, int port );
    217 void msn_ns_close( struct msn_handler_data *handler );
    218 void msn_auth_got_passport_token( struct im_connection *ic, const char *token, const char *error );
    219 void msn_auth_got_contact_list( struct im_connection *ic );
    220 int msn_ns_finish_login( struct im_connection *ic );
     163gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond );
    221164
    222165/* msn_util.c */
     166int msn_write( struct im_connection *ic, char *s, int len );
    223167int msn_logged_in( struct im_connection *ic );
    224 int msn_buddy_list_add( struct im_connection *ic, msn_buddy_flags_t list, const char *who, const char *realname_, const char *group );
    225 int msn_buddy_list_remove( struct im_connection *ic, msn_buddy_flags_t list, const char *who, const char *group );
    226 void msn_buddy_ask( bee_user_t *bu );
     168int msn_buddy_list_add( struct im_connection *ic, const char *list, const char *who, const char *realname_, const char *group );
     169int msn_buddy_list_remove( struct im_connection *ic, char *list, const char *who, const char *group );
     170void msn_buddy_ask( struct im_connection *ic, char *handle, char *realname );
    227171char *msn_findheader( char *text, char *header, int len );
    228172char **msn_linesplit( char *line );
    229173int msn_handler( struct msn_handler_data *h );
     174char *msn_http_encode( const char *input );
    230175void msn_msgq_purge( struct im_connection *ic, GSList **list );
    231 char *msn_p11_challenge( char *challenge );
    232 gint msn_domaintree_cmp( gconstpointer a_, gconstpointer b_ );
    233 struct msn_group *msn_group_by_name( struct im_connection *ic, const char *name );
    234 struct msn_group *msn_group_by_id( struct im_connection *ic, const char *id );
    235 int msn_ns_set_display_name( struct im_connection *ic, const char *value );
     176gboolean msn_set_display_name( struct im_connection *ic, const char *rawname );
    236177
    237178/* tables.c */
     
    242183
    243184/* sb.c */
    244 int msn_sb_write( struct msn_switchboard *sb, const char *fmt, ... );
     185int msn_sb_write( struct msn_switchboard *sb, char *s, int len );
    245186struct msn_switchboard *msn_sb_create( struct im_connection *ic, char *host, int port, char *key, int session );
    246187struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, char *handle );
     
    255196void msn_sb_stop_keepalives( struct msn_switchboard *sb );
    256197
     198/* invitation.c */
     199void msn_ftp_transfer_request( struct im_connection *ic, file_transfer_t *ft, char *who );
     200
    257201#endif //_MSN_H
Note: See TracChangeset for help on using the changeset viewer.