Mercurial > pidgin.yaz
annotate src/protocols/msn/error.c @ 7104:7700a28929bd
[gaim-migrate @ 7669]
When retrieving user info for an MSN user, the prpl checks if the info is
empty. If so, it displays an error dialog indicating so. Otherwise, it
displays the info.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 01 Oct 2003 05:42:40 +0000 |
parents | 0cacce490486 |
children | 4de49af535b3 |
rev | line source |
---|---|
5309 | 1 /** |
2 * @file error.c Error functions | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> | |
6701
b7e113a59b51
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
7 * |
5309 | 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 #include "msn.h" | |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
23 #include "error.h" |
5309 | 24 |
25 const char * | |
26 msn_error_get_text(unsigned int type) | |
27 { | |
28 static char msg[MSN_BUF_LEN]; | |
29 | |
30 switch (type) { | |
31 case 200: | |
32 g_snprintf(msg, sizeof(msg), | |
33 _("Syntax Error (probably a Gaim bug)")); | |
34 break; | |
35 case 201: | |
36 g_snprintf(msg, sizeof(msg), | |
37 _("Invalid Parameter (probably a Gaim bug)")); | |
38 break; | |
39 case 205: | |
40 g_snprintf(msg, sizeof(msg), _("Invalid User")); | |
41 break; | |
42 case 206: | |
43 g_snprintf(msg, sizeof(msg), | |
44 _("Fully Qualified Domain Name missing")); | |
45 break; | |
46 case 207: | |
7086
0cacce490486
[gaim-migrate @ 7651]
Christian Hammond <chipx86@chipx86.com>
parents:
6887
diff
changeset
|
47 g_snprintf(msg, sizeof(msg), _("Already Logged In")); |
5309 | 48 break; |
49 case 208: | |
50 g_snprintf(msg, sizeof(msg), _("Invalid Username")); | |
51 break; | |
52 case 209: | |
53 g_snprintf(msg, sizeof(msg), _("Invalid Friendly Name")); | |
54 break; | |
55 case 210: | |
56 g_snprintf(msg, sizeof(msg), _("List Full")); | |
57 break; | |
58 case 215: | |
59 g_snprintf(msg, sizeof(msg), _("Already there")); | |
60 break; | |
61 case 216: | |
62 g_snprintf(msg, sizeof(msg), _("Not on list")); | |
63 break; | |
64 case 217: | |
65 g_snprintf(msg, sizeof(msg), _("User is offline")); | |
66 break; | |
67 case 218: | |
68 g_snprintf(msg, sizeof(msg), _("Already in the mode")); | |
69 break; | |
70 case 219: | |
71 g_snprintf(msg, sizeof(msg), _("Already in opposite list")); | |
72 break; | |
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
73 case 223: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
74 g_snprintf(msg, sizeof(msg), _("Too many groups")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
75 break; |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
76 case 224: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
77 g_snprintf(msg, sizeof(msg), _("Invalid group")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
78 break; |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
79 case 225: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
80 g_snprintf(msg, sizeof(msg), _("User not in group")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
81 break; |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
82 case 229: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
83 g_snprintf(msg, sizeof(msg), _("Group name too long")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
84 break; |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
85 case 230: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
86 g_snprintf(msg, sizeof(msg), _("Cannot remove group zero")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
87 break; |
5309 | 88 case 231: |
89 g_snprintf(msg, sizeof(msg), | |
90 _("Tried to add a contact to a group " | |
91 "that doesn't exist")); | |
92 break; | |
93 case 280: | |
94 g_snprintf(msg, sizeof(msg), _("Switchboard failed")); | |
95 break; | |
96 case 281: | |
97 g_snprintf(msg, sizeof(msg), _("Notify Transfer failed")); | |
98 break; | |
99 | |
100 case 300: | |
101 g_snprintf(msg, sizeof(msg), _("Required fields missing")); | |
102 break; | |
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
103 case 301: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
104 g_snprintf(msg, sizeof(msg), _("Too many hits to a FND")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
105 break; |
5309 | 106 case 302: |
107 g_snprintf(msg, sizeof(msg), _("Not logged in")); | |
108 break; | |
109 | |
110 case 500: | |
111 g_snprintf(msg, sizeof(msg), _("Internal server error")); | |
112 break; | |
113 case 501: | |
114 g_snprintf(msg, sizeof(msg), _("Database server error")); | |
115 break; | |
116 case 510: | |
117 g_snprintf(msg, sizeof(msg), _("File operation error")); | |
118 break; | |
119 case 520: | |
120 g_snprintf(msg, sizeof(msg), _("Memory allocation error")); | |
121 break; | |
122 case 540: | |
123 g_snprintf(msg, sizeof(msg), _("Wrong CHL value sent to server")); | |
124 break; | |
125 | |
126 case 600: | |
127 g_snprintf(msg, sizeof(msg), _("Server busy")); | |
128 break; | |
129 case 601: | |
130 g_snprintf(msg, sizeof(msg), _("Server unavailable")); | |
131 break; | |
132 case 602: | |
133 g_snprintf(msg, sizeof(msg), _("Peer Notification server down")); | |
134 break; | |
135 case 603: | |
136 g_snprintf(msg, sizeof(msg), _("Database connect error")); | |
137 break; | |
138 case 604: | |
139 g_snprintf(msg, sizeof(msg), | |
140 _("Server is going down (abandon ship)")); | |
141 break; | |
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
142 case 605: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
143 g_snprintf(msg, sizeof(msg), _("Server unavailable")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
144 break; |
5309 | 145 |
146 case 707: | |
147 g_snprintf(msg, sizeof(msg), _("Error creating connection")); | |
148 break; | |
149 case 710: | |
150 g_snprintf(msg, sizeof(msg), | |
151 _("CVR parameters are either unknown or not allowed")); | |
152 break; | |
153 case 711: | |
154 g_snprintf(msg, sizeof(msg), _("Unable to write")); | |
155 break; | |
156 case 712: | |
157 g_snprintf(msg, sizeof(msg), _("Session overload")); | |
158 break; | |
159 case 713: | |
160 g_snprintf(msg, sizeof(msg), _("User is too active")); | |
161 break; | |
162 case 714: | |
163 g_snprintf(msg, sizeof(msg), _("Too many sessions")); | |
164 break; | |
165 case 715: | |
166 g_snprintf(msg, sizeof(msg), _("Not expected")); | |
167 break; | |
168 case 717: | |
169 g_snprintf(msg, sizeof(msg), _("Bad friend file")); | |
170 break; | |
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
171 case 731: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
172 g_snprintf(msg, sizeof(msg), _("Not expected")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
173 break; |
5309 | 174 |
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
175 case 800: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
176 g_snprintf(msg, sizeof(msg), |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
177 _("Friendly name changes too rapidly")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
178 break; |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
179 |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
180 case 910: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
181 case 912: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
182 case 918: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
183 case 919: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
184 case 921: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
185 case 922: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
186 g_snprintf(msg, sizeof(msg), _("Server too busy")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
187 break; |
5309 | 188 case 911: |
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
189 case 917: |
5309 | 190 g_snprintf(msg, sizeof(msg), _("Authentication failed")); |
191 break; | |
192 case 913: | |
193 g_snprintf(msg, sizeof(msg), _("Not allowed when offline")); | |
194 break; | |
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
195 case 914: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
196 case 915: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
197 case 916: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
198 g_snprintf(msg, sizeof(msg), _("Server unavailable")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
199 break; |
5309 | 200 case 920: |
201 g_snprintf(msg, sizeof(msg), _("Not accepting new users")); | |
202 break; | |
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
203 case 923: |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
204 g_snprintf(msg, sizeof(msg), |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
205 _("Kids Passport without parental consent")); |
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
206 break; |
5309 | 207 case 924: |
208 g_snprintf(msg, sizeof(msg), | |
209 _("Passport account not yet verified")); | |
210 break; | |
211 | |
212 default: | |
213 g_snprintf(msg, sizeof(msg), _("Unknown Error Code %d"), type); | |
214 break; | |
215 } | |
216 | |
217 return msg; | |
218 } | |
219 | |
220 void | |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
221 msn_error_handle(MsnSession *session, unsigned int type) |
5309 | 222 { |
223 const char *text; | |
224 | |
225 text = msn_error_get_text(type); | |
226 | |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
227 gaim_notify_error(session->account->gc, NULL, text, NULL); |
5309 | 228 } |