Changeset 8e9e2b7 for protocols/msn/msn.h
- Timestamp:
- 2010-10-03T02:45:26Z (14 years ago)
- Branches:
- master
- Children:
- 04f0c10
- Parents:
- 88de0c9 (diff), 2af3e23 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.h
r88de0c9 r8e9e2b7 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-20 04Wilmer van der Gaast and others *4 * Copyright 2002-2010 Wilmer van der Gaast and others * 5 5 \********************************************************************/ 6 6 … … 39 39 #endif 40 40 41 #define QRY_NAME "msmsgs@msnmsgr.com" 42 #define QRY_CODE "Q1P7W2E4J9R8U3S5" 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" 43 58 44 59 #define MSN_SB_NEW -24062002 … … 61 76 #define PROFILE_URL "http://members.msn.com/" 62 77 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 63 102 struct msn_data 64 103 { 65 104 struct im_connection *ic; 66 105 67 int fd;68 struct msn_handler_data *handler;106 struct msn_handler_data ns[1]; 107 msn_flags_t flags; 69 108 70 109 int trId; 71 72 GSList *msgq, *grpq; 110 char *tokens[4]; 111 char *lock_key, *pp_policy; 112 113 GSList *msgq, *grpq, *soapq; 73 114 GSList *switchboards; 74 115 int sb_failures; 75 116 time_t first_sb_failure; 76 GSList *filetransfers;77 117 78 118 const struct msn_away_state *away_state; 79 int buddycount; 80 int groupcount; 81 char **grouplist; 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; 82 126 }; 83 127 … … 86 130 struct im_connection *ic; 87 131 132 /* The following two are also in the handler. TODO: Clean up. */ 88 133 int fd; 89 134 gint inp; … … 127 172 }; 128 173 129 struct 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 ); 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; 142 194 }; 143 195 … … 161 213 162 214 /* ns.c */ 163 gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond ); 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 ); 164 221 165 222 /* msn_util.c */ 166 int msn_write( struct im_connection *ic, char *s, int len );167 223 int msn_logged_in( struct im_connection *ic ); 168 int msn_buddy_list_add( struct im_connection *ic, const char *list, const char *who, const char *realname_, const char *group );169 int msn_buddy_list_remove( struct im_connection *ic, char *list, const char *who, const char *group );170 void msn_buddy_ask( struct im_connection *ic, char *handle, char *realname);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 ); 171 227 char *msn_findheader( char *text, char *header, int len ); 172 228 char **msn_linesplit( char *line ); 173 229 int msn_handler( struct msn_handler_data *h ); 174 char *msn_http_encode( const char *input );175 230 void msn_msgq_purge( struct im_connection *ic, GSList **list ); 176 gboolean msn_set_display_name( struct im_connection *ic, const char *rawname ); 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 ); 177 236 178 237 /* tables.c */ … … 183 242 184 243 /* sb.c */ 185 int msn_sb_write( struct msn_switchboard *sb, c har *s, int len);244 int msn_sb_write( struct msn_switchboard *sb, const char *fmt, ... ); 186 245 struct msn_switchboard *msn_sb_create( struct im_connection *ic, char *host, int port, char *key, int session ); 187 246 struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, char *handle ); … … 196 255 void msn_sb_stop_keepalives( struct msn_switchboard *sb ); 197 256 198 /* invitation.c */199 void msn_ftp_transfer_request( struct im_connection *ic, file_transfer_t *ft, char *who );200 201 257 #endif //_MSN_H
Note: See TracChangeset
for help on using the changeset viewer.