Mercurial > pidgin
annotate src/protocols/msn/error.c @ 8808:bbd8cdaf0ad5
[gaim-migrate @ 9570]
A massive patch by shx to reorganize MSN some more and add command
processor support. This allows us to do cool things like produce more
detailed error messages. For example, the Invalid Username dialog now
shows the username of the invalid user.
I modified the aforementioned dialog so it'll look a little nicer looking,
and also mention the account this happened on. It also removes the user
from your blist, as there's no point to keeping the user on there.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sun, 25 Apr 2004 22:02:06 +0000 |
| parents | c47a90a0a3b1 |
| children | ab6636c5a136 |
| rev | line source |
|---|---|
| 5309 | 1 /** |
| 2 * @file error.c Error functions | |
| 3 * | |
| 4 * gaim | |
| 5 * | |
|
8475
06f57183e29f
[gaim-migrate @ 9208]
Christian Hammond <chipx86@chipx86.com>
parents:
8255
diff
changeset
|
6 * Copyright (C) 2003-2004 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) { | |
|
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
31 case 0: |
|
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
32 g_snprintf(msg, sizeof(msg), |
|
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
33 _("Unable to parse message")); |
| 5309 | 34 case 200: |
| 35 g_snprintf(msg, sizeof(msg), | |
| 36 _("Syntax Error (probably a Gaim bug)")); | |
| 37 break; | |
| 38 case 201: | |
| 39 g_snprintf(msg, sizeof(msg), | |
|
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
40 _("Invalid email address")); |
| 5309 | 41 break; |
| 42 case 205: | |
|
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
43 g_snprintf(msg, sizeof(msg), _("User does not exist")); |
| 5309 | 44 break; |
| 45 case 206: | |
| 46 g_snprintf(msg, sizeof(msg), | |
| 47 _("Fully Qualified Domain Name missing")); | |
| 48 break; | |
| 49 case 207: | |
|
7086
0cacce490486
[gaim-migrate @ 7651]
Christian Hammond <chipx86@chipx86.com>
parents:
6887
diff
changeset
|
50 g_snprintf(msg, sizeof(msg), _("Already Logged In")); |
| 5309 | 51 break; |
| 52 case 208: | |
| 53 g_snprintf(msg, sizeof(msg), _("Invalid Username")); | |
| 54 break; | |
| 55 case 209: | |
| 56 g_snprintf(msg, sizeof(msg), _("Invalid Friendly Name")); | |
| 57 break; | |
| 58 case 210: | |
| 59 g_snprintf(msg, sizeof(msg), _("List Full")); | |
| 60 break; | |
| 61 case 215: | |
| 62 g_snprintf(msg, sizeof(msg), _("Already there")); | |
| 63 break; | |
| 64 case 216: | |
| 65 g_snprintf(msg, sizeof(msg), _("Not on list")); | |
| 66 break; | |
| 67 case 217: | |
| 68 g_snprintf(msg, sizeof(msg), _("User is offline")); | |
| 69 break; | |
| 70 case 218: | |
| 71 g_snprintf(msg, sizeof(msg), _("Already in the mode")); | |
| 72 break; | |
| 73 case 219: | |
| 74 g_snprintf(msg, sizeof(msg), _("Already in opposite list")); | |
| 75 break; | |
|
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
76 case 223: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
77 g_snprintf(msg, sizeof(msg), _("Too many groups")); |
|
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 224: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
80 g_snprintf(msg, sizeof(msg), _("Invalid 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 225: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
83 g_snprintf(msg, sizeof(msg), _("User not in group")); |
|
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 229: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
86 g_snprintf(msg, sizeof(msg), _("Group name too long")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
87 break; |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
88 case 230: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
89 g_snprintf(msg, sizeof(msg), _("Cannot remove group zero")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
90 break; |
| 5309 | 91 case 231: |
| 92 g_snprintf(msg, sizeof(msg), | |
| 93 _("Tried to add a contact to a group " | |
| 94 "that doesn't exist")); | |
| 95 break; | |
| 96 case 280: | |
| 97 g_snprintf(msg, sizeof(msg), _("Switchboard failed")); | |
| 98 break; | |
| 99 case 281: | |
| 100 g_snprintf(msg, sizeof(msg), _("Notify Transfer failed")); | |
| 101 break; | |
| 102 | |
| 103 case 300: | |
| 104 g_snprintf(msg, sizeof(msg), _("Required fields missing")); | |
| 105 break; | |
|
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
106 case 301: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
107 g_snprintf(msg, sizeof(msg), _("Too many hits to a FND")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
108 break; |
| 5309 | 109 case 302: |
| 110 g_snprintf(msg, sizeof(msg), _("Not logged in")); | |
| 111 break; | |
| 112 | |
| 113 case 500: | |
|
8255
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
114 g_snprintf(msg, sizeof(msg), _("Service Temporarily Unavailable")); |
| 5309 | 115 break; |
| 116 case 501: | |
| 117 g_snprintf(msg, sizeof(msg), _("Database server error")); | |
| 118 break; | |
|
8255
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
119 case 502: |
|
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
120 g_snprintf(msg, sizeof(msg), _("Command disabled")); |
|
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
121 break; |
| 5309 | 122 case 510: |
| 123 g_snprintf(msg, sizeof(msg), _("File operation error")); | |
| 124 break; | |
| 125 case 520: | |
| 126 g_snprintf(msg, sizeof(msg), _("Memory allocation error")); | |
| 127 break; | |
| 128 case 540: | |
| 129 g_snprintf(msg, sizeof(msg), _("Wrong CHL value sent to server")); | |
| 130 break; | |
| 131 | |
| 132 case 600: | |
| 133 g_snprintf(msg, sizeof(msg), _("Server busy")); | |
| 134 break; | |
| 135 case 601: | |
| 136 g_snprintf(msg, sizeof(msg), _("Server unavailable")); | |
| 137 break; | |
| 138 case 602: | |
| 139 g_snprintf(msg, sizeof(msg), _("Peer Notification server down")); | |
| 140 break; | |
| 141 case 603: | |
| 142 g_snprintf(msg, sizeof(msg), _("Database connect error")); | |
| 143 break; | |
| 144 case 604: | |
| 145 g_snprintf(msg, sizeof(msg), | |
| 146 _("Server is going down (abandon ship)")); | |
| 147 break; | |
|
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
148 case 605: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
149 g_snprintf(msg, sizeof(msg), _("Server unavailable")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
150 break; |
| 5309 | 151 |
| 152 case 707: | |
| 153 g_snprintf(msg, sizeof(msg), _("Error creating connection")); | |
| 154 break; | |
| 155 case 710: | |
| 156 g_snprintf(msg, sizeof(msg), | |
| 157 _("CVR parameters are either unknown or not allowed")); | |
| 158 break; | |
| 159 case 711: | |
| 160 g_snprintf(msg, sizeof(msg), _("Unable to write")); | |
| 161 break; | |
| 162 case 712: | |
| 163 g_snprintf(msg, sizeof(msg), _("Session overload")); | |
| 164 break; | |
| 165 case 713: | |
| 166 g_snprintf(msg, sizeof(msg), _("User is too active")); | |
| 167 break; | |
| 168 case 714: | |
| 169 g_snprintf(msg, sizeof(msg), _("Too many sessions")); | |
| 170 break; | |
| 171 case 715: | |
|
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
172 g_snprintf(msg, sizeof(msg), _("Passport not verified")); |
| 5309 | 173 break; |
| 174 case 717: | |
| 175 g_snprintf(msg, sizeof(msg), _("Bad friend file")); | |
| 176 break; | |
|
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
177 case 731: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
178 g_snprintf(msg, sizeof(msg), _("Not expected")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
179 break; |
| 5309 | 180 |
|
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
181 case 800: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
182 g_snprintf(msg, sizeof(msg), |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
183 _("Friendly name changes too rapidly")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
184 break; |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
185 |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
186 case 910: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
187 case 912: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
188 case 918: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
189 case 919: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
190 case 921: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
191 case 922: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
192 g_snprintf(msg, sizeof(msg), _("Server too busy")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
193 break; |
| 5309 | 194 case 911: |
|
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
195 case 917: |
| 5309 | 196 g_snprintf(msg, sizeof(msg), _("Authentication failed")); |
| 197 break; | |
| 198 case 913: | |
| 199 g_snprintf(msg, sizeof(msg), _("Not allowed when offline")); | |
| 200 break; | |
|
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
201 case 914: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
202 case 915: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
203 case 916: |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
204 g_snprintf(msg, sizeof(msg), _("Server unavailable")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
205 break; |
|
8255
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
206 case 920: |
| 5309 | 207 g_snprintf(msg, sizeof(msg), _("Not accepting new users")); |
| 208 break; | |
|
8255
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
209 case 923: |
|
6887
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
210 g_snprintf(msg, sizeof(msg), |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
211 _("Kids Passport without parental consent")); |
|
5d48764e711c
[gaim-migrate @ 7433]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
212 break; |
|
8255
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
213 case 924: |
| 5309 | 214 g_snprintf(msg, sizeof(msg), |
| 215 _("Passport account not yet verified")); | |
| 216 break; | |
|
8255
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
217 case 928: |
|
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
218 g_snprintf(msg, sizeof(msg), _("Bad ticket")); |
|
4de49af535b3
[gaim-migrate @ 8978]
Christian Hammond <chipx86@chipx86.com>
parents:
7086
diff
changeset
|
219 break; |
| 5309 | 220 |
| 221 default: | |
| 222 g_snprintf(msg, sizeof(msg), _("Unknown Error Code %d"), type); | |
| 223 break; | |
| 224 } | |
| 225 | |
| 226 return msg; | |
| 227 } | |
| 228 | |
| 229 void | |
|
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5309
diff
changeset
|
230 msn_error_handle(MsnSession *session, unsigned int type) |
| 5309 | 231 { |
|
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
232 char buf[MSN_BUF_LEN]; |
| 5309 | 233 |
|
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
234 g_snprintf(buf, sizeof(buf), _("MSN Error: %s\n"), |
|
8662
c47a90a0a3b1
[gaim-migrate @ 9414]
Christian Hammond <chipx86@chipx86.com>
parents:
8569
diff
changeset
|
235 msn_error_get_text(type)); |
| 5309 | 236 |
|
8569
ee13d1befabe
[gaim-migrate @ 9317]
Christian Hammond <chipx86@chipx86.com>
parents:
8475
diff
changeset
|
237 gaim_notify_error(session->account->gc, NULL, buf, NULL); |
| 5309 | 238 } |
