Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/xmpp.c @ 1604:351427ef0b4b
Remove #include's of C files
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 11 Oct 2009 15:59:53 +0200 |
parents | f4a2c6f767d1 |
children | 6db9f403f707 |
comparison
equal
deleted
inserted
replaced
1603:54029aba9452 | 1604:351427ef0b4b |
---|---|
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
22 * USA | 22 * USA |
23 */ | 23 */ |
24 #include <stdlib.h> | 24 #include <stdlib.h> |
25 #include <string.h> | 25 #include <string.h> |
26 #include <sys/utsname.h> | 26 |
27 | 27 #include "xmpp.h" |
28 #include "xmpp_helper.h" | |
29 #include "xmpp_iq.h" | |
30 #include "xmpp_iqrequest.h" | |
31 #include "xmpp_muc.h" | |
32 #include "xmpp_s10n.h" | |
28 #include "caps.h" | 33 #include "caps.h" |
29 #include "commands.h" | |
30 #include "events.h" | 34 #include "events.h" |
31 #include "histolog.h" | 35 #include "histolog.h" |
32 #include "hooks.h" | 36 #include "hooks.h" |
33 #include "logprint.h" | |
34 #include "otr.h" | 37 #include "otr.h" |
35 #include "roster.h" | 38 #include "roster.h" |
36 #include "screen.h" | 39 #include "screen.h" |
37 #include "settings.h" | 40 #include "settings.h" |
38 #include "utils.h" | 41 #include "utils.h" |
39 #include "xmpp.h" | |
40 #include "xmpp_helper.h" | |
41 #include "xmpp_defines.h" | |
42 | 42 |
43 #define RECONNECTION_TIMEOUT 60L | 43 #define RECONNECTION_TIMEOUT 60L |
44 | 44 |
45 LmConnection* lconnection; | 45 LmConnection* lconnection; |
46 static guint AutoConnection; | 46 static guint AutoConnection; |
47 | 47 |
48 inline void update_last_use(void); | 48 inline void update_last_use(void); |
49 inline gboolean xmpp_reconnect(); | 49 inline gboolean xmpp_reconnect(); |
50 | 50 |
51 static enum imstatus mystatus = offline; | 51 enum imstatus mystatus = offline; |
52 static enum imstatus mywantedstatus = available; | 52 static enum imstatus mywantedstatus = available; |
53 static gchar *mystatusmsg; | 53 gchar *mystatusmsg; |
54 | 54 |
55 char imstatus2char[imstatus_size+1] = { | 55 char imstatus2char[imstatus_size+1] = { |
56 '_', 'o', 'f', 'd', 'n', 'a', 'i', '\0' | 56 '_', 'o', 'f', 'd', 'n', 'a', 'i', '\0' |
57 }; | 57 }; |
58 | 58 |
59 static char *imstatus_showmap[] = { | 59 char *imstatus_showmap[] = { |
60 "", | 60 "", |
61 "", | 61 "", |
62 "chat", | 62 "chat", |
63 "dnd", | 63 "dnd", |
64 "xa", | 64 "xa", |
65 "away", | 65 "away", |
66 "" | 66 "" |
67 }; | 67 }; |
68 | 68 |
69 static LmMessageNode *bookmarks = NULL; | 69 LmMessageNode *bookmarks = NULL; |
70 static LmMessageNode *rosternotes = NULL; | 70 LmMessageNode *rosternotes = NULL; |
71 | |
72 struct xmpp_error { | |
73 guint code; | |
74 const char *code_str; | |
75 const char *meaning; | |
76 const char *condition; | |
77 const char *type; | |
78 } xmpp_errors[] = { | |
79 {XMPP_ERROR_REDIRECT, "302", | |
80 "Redirect", "redirect", "modify"}, | |
81 {XMPP_ERROR_BAD_REQUEST, "400", | |
82 "Bad Request", "bad-request", "modify"}, | |
83 {XMPP_ERROR_NOT_AUTHORIZED, "401", | |
84 "Not Authorized", "not-authorized", "auth"}, | |
85 {XMPP_ERROR_PAYMENT_REQUIRED, "402", | |
86 "Payment Required", "payment-required", "auth"}, | |
87 {XMPP_ERROR_FORBIDDEN, "403", | |
88 "Forbidden", "forbidden", "auth"}, | |
89 {XMPP_ERROR_NOT_FOUND, "404", | |
90 "Not Found", "item-not-found", "cancel"}, | |
91 {XMPP_ERROR_NOT_ALLOWED, "405", | |
92 "Not Allowed", "not-allowed", "cancel"}, | |
93 {XMPP_ERROR_NOT_ACCEPTABLE, "406", | |
94 "Not Acceptable", "not-acceptable", "modify"}, | |
95 {XMPP_ERROR_REGISTRATION_REQUIRED, "407", | |
96 "Registration required", "registration-required", "auth"}, | |
97 {XMPP_ERROR_REQUEST_TIMEOUT, "408", | |
98 "Request Timeout", "remote-server-timeout", "wait"}, | |
99 {XMPP_ERROR_CONFLICT, "409", | |
100 "Conflict", "conflict", "cancel"}, | |
101 {XMPP_ERROR_INTERNAL_SERVER_ERROR, "500", | |
102 "Internal Server Error", "internal-server-error", "wait"}, | |
103 {XMPP_ERROR_NOT_IMPLEMENTED, "501", | |
104 "Not Implemented", "feature-not-implemented", "cancel"}, | |
105 {XMPP_ERROR_REMOTE_SERVER_ERROR, "502", | |
106 "Remote Server Error", "service-unavailable", "wait"}, | |
107 {XMPP_ERROR_SERVICE_UNAVAILABLE, "503", | |
108 "Service Unavailable", "service-unavailable", "cancel"}, | |
109 {XMPP_ERROR_REMOTE_SERVER_TIMEOUT, "504", | |
110 "Remote Server Timeout", "remote-server-timeout", "wait"}, | |
111 {XMPP_ERROR_DISCONNECTED, "510", | |
112 "Disconnected", "service-unavailable", "cancel"}, | |
113 {0, NULL, NULL, NULL, NULL} | |
114 }; | |
115 | |
116 #include "xmpp_helper.c" | |
117 #include "xmpp_iq.c" | |
118 #include "xmpp_iqrequest.c" | |
119 #include "xmpp_muc.c" | |
120 #include "xmpp_s10n.c" | |
121 | 71 |
122 static struct IqHandlers | 72 static struct IqHandlers |
123 { | 73 { |
124 const gchar *xmlns; | 74 const gchar *xmlns; |
125 LmHandleMessageFunction handler; | 75 LmHandleMessageFunction handler; |