comparison src/protocols/msn/msn.h @ 4542:86b0a0243be8

[gaim-migrate @ 4821] Split up the MSN module a bit and added file receive support. Caution: I lost some data in a large file that was sent to me. Don't rely on this yet. I'll get it all fixed tomorrow. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 06 Feb 2003 10:13:18 +0000
parents
children 3145c5c45877
comparison
equal deleted inserted replaced
4541:0626ec2f2feb 4542:86b0a0243be8
1 /**
2 * @file msn.h The MSN protocol plugin
3 *
4 * gaim
5 *
6 * Copyright (C) 2003, Christian Hammond <chipx86@gnupdate.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23 #ifndef _MSN_H_
24 #define _MSN_H_
25
26 #include "config.h"
27
28 #ifndef _WIN32
29 #include <unistd.h>
30 #else
31 #include <winsock.h>
32 #include <io.h>
33 #endif
34
35
36 #include <sys/stat.h>
37 #include <stdlib.h>
38 #include <string.h>
39 #include <errno.h>
40 #include <stdio.h>
41 #include <ctype.h>
42 #ifndef _WIN32
43 #include <netdb.h>
44 #endif
45 #include "gaim.h"
46 #include "prpl.h"
47 #include "proxy.h"
48 #include "md5.h"
49
50 #ifdef _WIN32
51 #include "win32dep.h"
52 #include "stdint.h"
53 #endif
54
55 #include "msg.h"
56 #include "switchboard.h"
57
58 #define MSN_BUF_LEN 8192
59 #define MIME_HEADER "MIME-Version: 1.0\r\n" \
60 "Content-Type: text/plain; charset=UTF-8\r\n" \
61 "User-Agent: Gaim/" VERSION "\r\n" \
62 "X-MMS-IM-Format: FN=Arial; EF=; CO=0; PF=0\r\n\r\n"
63
64 #define HOTMAIL_URL "http://www.hotmail.com/cgi-bin/folders"
65 #define PASSPORT_URL "http://lc1.law13.hotmail.passport.com/cgi-bin/dologin?login="
66
67 #define MSN_ONLINE 1
68 #define MSN_BUSY 2
69 #define MSN_IDLE 3
70 #define MSN_BRB 4
71 #define MSN_AWAY 5
72 #define MSN_PHONE 6
73 #define MSN_LUNCH 7
74 #define MSN_OFFLINE 8
75 #define MSN_HIDDEN 9
76
77 #define USEROPT_HOTMAIL 0
78
79 #define USEROPT_MSNSERVER 3
80 #define MSN_SERVER "messenger.hotmail.com"
81 #define USEROPT_MSNPORT 4
82 #define MSN_PORT 1863
83
84 #define MSN_TYPING_RECV_TIMEOUT 6
85 #define MSN_TYPING_SEND_TIMEOUT 4
86
87 #define MSN_FT_GUID "{5D3E02AB-6190-11d3-BBBB-00C04F795683}"
88
89 #define GET_NEXT(tmp) \
90 while (*(tmp) && *(tmp) != ' ' && *(tmp) != '\r') \
91 (tmp)++; \
92 *(tmp)++ = 0; \
93 while (*(tmp) && *(tmp) == ' ') \
94 (tmp)++;
95
96
97 struct msn_xfer_data {
98 int inpa;
99
100 uint32_t cookie;
101 uint32_t authcookie;
102
103 gboolean transferring;
104
105 char *rxqueue;
106 int rxlen;
107 gboolean msg;
108 char *msguser;
109 int msglen;
110 };
111
112 struct msn_data {
113 int fd;
114 uint32_t trId;
115 int inpa;
116
117 char *rxqueue;
118 int rxlen;
119 gboolean msg;
120 char *msguser;
121 int msglen;
122
123 GSList *switches;
124 GSList *fl;
125 GSList *permit;
126 GSList *deny;
127 GSList *file_transfers;
128
129 char *kv;
130 char *sid;
131 char *mspauth;
132 unsigned long sl;
133 char *passport;
134 };
135
136 struct msn_buddy {
137 char *user;
138 char *friend;
139 };
140
141 /**
142 * Processes a file transfer message.
143 *
144 * @param ms The switchboard.
145 * @param msg The message.
146 */
147 void msn_process_ft_msg(struct msn_switchboard *ms, char *msg);
148
149 char *handle_errcode(char *buf, gboolean show);
150 char *url_decode(const char *msg);
151
152 #endif /* _MSN_H_ */