Ticket #25: 0001_handle_login_errors.patch

File 0001_handle_login_errors.patch, 10.3 KB (added by difro, 4 years ago)

로그인실패 처리하는 패치입니다. (knateon 참고)

Line 
1diff --git a/po/ko.po b/po/ko.po
2index 6480e8c..0bff5b2 100644
3--- a/po/ko.po
4+++ b/po/ko.po
5@@ -5,7 +5,7 @@ msgid ""
6 msgstr ""
7 "Project-Id-Version: pidgin-nateon\n"
8 "Report-Msgid-Bugs-To: \n"
9-"POT-Creation-Date: 2008-02-26 16:48+0900\n"
10+"POT-Creation-Date: 2008-03-19 14:21+0900\n"
11 "PO-Revision-Date: 2008-03-06 17:24+0900\n"
12 "Last-Translator: Hansun Lee <hansun.lee@gmail.com>\n"
13 "Language-Team: Hansun Lee <hansun.lee@gmail.com>\n"
14@@ -23,13 +23,22 @@ msgstr "%s (%s) 에서 친구 목록의 동Ʞ가 발생했습니닀."
15 
16 #: ../src/dialog.c:118
17 #, c-format
18-msgid "%s on the local list is inside the group \"%s\" but not on the server list. Do you want this buddy to be added?"
19-msgstr "로컬 친구 목록에 Ʞ록되얎 있는 %s 님은 귞룹 \"%s\" 에 소속되얎 있윌나, 서버 상의 목록에서는 귞렇게 되얎 있지 않습니닀. 서버 상의 목록에 ê·ž 친구륌 추가하시겠습니까?"
20+msgid ""
21+"%s on the local list is inside the group \"%s\" but not on the server list. "
22+"Do you want this buddy to be added?"
23+msgstr ""
24+"로컬 친구 목록에 Ʞ록되얎 있는 %s 님은 귞룹 \"%s\" 에 소속되얎 있윌나, 서버 "
25+"상의 목록에서는 귞렇게 되얎 있지 않습니닀. 서버 상의 목록에 ê·ž 친구륌 추가하"
26+"시겠습니까?"
27 
28 #: ../src/dialog.c:126
29 #, c-format
30-msgid "%s is on the local list but not on the server list. Do you want this buddy to be added?"
31-msgstr "로컬 친구 목록에 Ʞ술되얎 있는 %s 님은 서버 상의 목록에 졎재하지 않습니닀. 서버 상의 목록에 ê·ž 친구륌 추가하시겠습니까?"
32+msgid ""
33+"%s is on the local list but not on the server list. Do you want this buddy "
34+"to be added?"
35+msgstr ""
36+"로컬 친구 목록에 Ʞ술되얎 있는 %s 님은 서버 상의 목록에 졎재하지 않습니닀. 서"
37+"버 상의 목록에 ê·ž 친구륌 추가하시겠습니까?"
38 
39 #: ../src/dialog.c:135
40 msgid "Yes"
41@@ -51,92 +60,88 @@ msgid "NATEON Error: %s\n"
42 msgstr "넀읎튞옚 였류: %s\n"
43 
44 # nateon message
45-#: ../src/nateon.c:138
46+#: ../src/nateon.c:139
47 msgid "Your new NateOn friendly name is too long."
48 msgstr "새 넀읎튞옚의 공개명읎 너묎 깁니닀."
49 
50 # nateon message
51-#: ../src/nateon.c:333
52+#: ../src/nateon.c:334
53 msgid "Set your friendly name."
54 msgstr "공개명을 섀정핎 죌십시였."
55 
56 # nateon message
57-#: ../src/nateon.c:334
58+#: ../src/nateon.c:335
59 msgid "This is the name that other NATEON buddies will see you as."
60 msgstr "넀읎튞옚의 닀륞 친구가 나륌 볌 때 표시되는 읎늄입니닀."
61 
62-#: ../src/nateon.c:337
63-#: ../src/nateon.c:355
64+#: ../src/nateon.c:338 ../src/nateon.c:356
65 msgid "OK"
66 msgstr "확읞"
67 
68-#: ../src/nateon.c:338
69-#: ../src/nateon.c:356
70+#: ../src/nateon.c:339 ../src/nateon.c:357
71 msgid "Cancel"
72 msgstr "췚소"
73 
74-#: ../src/nateon.c:352
75-#: ../src/nateon.c:353
76+#: ../src/nateon.c:353 ../src/nateon.c:354
77 msgid "View Buddies By."
78 msgstr "친구 볎Ʞ 방식"
79 
80-#: ../src/nateon.c:359
81-#: ../src/nateon.c:737
82+#: ../src/nateon.c:360 ../src/nateon.c:753
83 msgid "Name"
84 msgstr "읎늄"
85 
86 # nateon message
87-#: ../src/nateon.c:360
88+#: ../src/nateon.c:361
89 msgid "Screen Name"
90 msgstr "대화명"
91 
92-#: ../src/nateon.c:361
93+#: ../src/nateon.c:362
94 msgid "Name and ID"
95 msgstr "읎늄+아읎디"
96 
97-#: ../src/nateon.c:362
98+#: ../src/nateon.c:363
99 msgid "Name and Screen Name"
100 msgstr "읎늄+대화명"
101 
102-#: ../src/nateon.c:532
103+#: ../src/nateon.c:533
104 msgid "_Send"
105 msgstr "볎낎Ʞ(_S)"
106 
107-#: ../src/nateon.c:533
108+#: ../src/nateon.c:534
109 msgid "Close"
110 msgstr "ë‹«êž°"
111 
112-#: ../src/nateon.c:742
113+#: ../src/nateon.c:758
114 msgid "Status"
115 msgstr "상태"
116 
117-#: ../src/nateon.c:742
118+#: ../src/nateon.c:758
119 msgid "Idle"
120 msgstr "대Ʞ 상태"
121 
122-#: ../src/nateon.c:776
123+#: ../src/nateon.c:792
124 msgid "Busy"
125 msgstr "닀륞 용묎 쀑입니닀."
126 
127-#: ../src/nateon.c:780
128+#: ../src/nateon.c:796
129 msgid "On The Phone"
130 msgstr "전화 쀑입니닀."
131 
132 # nateon message
133-#: ../src/nateon.c:784
134+#: ../src/nateon.c:800
135 msgid "In meeting"
136 msgstr "회의 쀑입니닀"
137 
138-#: ../src/nateon.c:808
139+#: ../src/nateon.c:824
140 msgid "Set Friendly Name..."
141 msgstr "공개명 섀정..."
142 
143-#: ../src/nateon.c:812
144+#: ../src/nateon.c:828
145 msgid "View Buddies By..."
146 msgstr "친구 볎Ʞ 방식..."
147 
148 # nateon message
149-#: ../src/nateon.c:816
150+#: ../src/nateon.c:832
151 msgid "Send SMS message..."
152 msgstr "SMS 메시지 전송..."
153 
154@@ -149,25 +154,25 @@ msgstr "SMS 메시지 전송..."
155 #. m = g_list_append(m, act);
156 #. }
157 #.
158-#: ../src/nateon.c:882
159+#: ../src/nateon.c:898
160 msgid "Send memo"
161 msgstr "쪜지 전송"
162 
163 # nateon message
164-#: ../src/nateon.c:885
165+#: ../src/nateon.c:901
166 msgid "Send SMS message"
167 msgstr "SMS 메섞지 전송"
168 
169 # nateon message
170-#: ../src/nateon.c:899
171+#: ../src/nateon.c:915
172 msgid "Copy buddy"
173 msgstr "친구 복사"
174 
175-#: ../src/nateon.c:906
176+#: ../src/nateon.c:922
177 msgid "Initiate _Chat"
178 msgstr "대화 시작(_C)"
179 
180-#: ../src/nateon.c:971
181+#: ../src/nateon.c:987
182 msgid "Failed to connect to server."
183 msgstr "서버 접속에 싀팚했습니닀."
184 
185@@ -182,35 +187,55 @@ msgstr "서버 접속에 싀팚했습니닀."
186 #. *< version
187 #. *  summary
188 #. *  description
189-#: ../src/nateon.c:2320
190-#: ../src/nateon.c:2322
191+#: ../src/nateon.c:2343 ../src/nateon.c:2345
192 msgid "NateOn Protocol Plugin"
193 msgstr "넀읎튞옚 프로토윜 플러귞읞"
194 
195-#: ../src/nateon.c:2352
196+#: ../src/nateon.c:2375
197 msgid "Server"
198 msgstr "서버"
199 
200-#: ../src/nateon.c:2357
201+#: ../src/nateon.c:2380
202 msgid "Port"
203 msgstr "포튞 번혞"
204 
205-#: ../src/notification.c:207
206+#: ../src/notification.c:208
207 #, c-format
208 msgid "%s is not a valid group."
209 msgstr "%s 은(는) 올바은 귞룹읎 아닙니닀."
210 
211-#: ../src/notification.c:212
212-#: ../src/session.c:340
213+#: ../src/notification.c:213 ../src/session.c:340
214 msgid "Unknown error."
215 msgstr "알 수 없는 였류입니닀."
216 
217-#: ../src/notification.c:215
218+#: ../src/notification.c:216
219 #, c-format
220 msgid "%s on %s (%s)"
221 msgstr "%2$s (%3$s) 의 %1$s"
222 
223-#: ../src/notification.c:1058
224+#: ../src/notification.c:419
225+msgid "ID does not exist. Please verify and retry."
226+msgstr "졎재하지 않는 아읎디입니닀. 확읞 후 닀시 시도핎 죌십시였."
227+
228+#: ../src/notification.c:423
229+msgid "Wrong password. Please verify and retry."
230+msgstr "비밀번혞가 틀렞습니닀. 확읞 후 닀시 시도핎 죌십시였."
231+
232+#: ../src/notification.c:427
233+msgid "Already logged in."
234+msgstr "읎믞 로귞읞읎 되있습니닀."
235+
236+#: ../src/notification.c:431
237+msgid "Connection is poor. Please retry connecting."
238+msgstr "접속읎 원활하지 못합니닀. 접속을 닀시 시도 바랍니닀."
239+
240+#: ../src/notification.c:435
241+msgid "Nateon server is under maintenance. Please wait and try again."
242+msgstr ""
243+"서버작업윌로 넀읎튞옚 접속 할 수 없습니닀.  닀음에 닀시 접속을 시도핎 죌십시"
244+"였."
245+
246+#: ../src/notification.c:1099
247 msgid "Unable to rename group"
248 msgstr "귞룹명을 변겜할 수 없습니닀."
249 
250@@ -226,8 +251,7 @@ msgstr "쓰는 쀑 였류"
251 msgid "Reading error"
252 msgstr "읜는 쀑 였류"
253 
254-#: ../src/servconn.c:133
255-#: ../src/session.c:332
256+#: ../src/servconn.c:133 ../src/session.c:332
257 msgid "Unknown error"
258 msgstr "알 수 없는 였류"
259 
260@@ -253,8 +277,7 @@ msgstr "읞슝할 수 없습니닀: %s"
261 msgid "Connecting"
262 msgstr "접속 쀑입니닀."
263 
264-#: ../src/session.c:356
265-#: ../src/session.c:358
266+#: ../src/session.c:356 ../src/session.c:358
267 msgid "Handshaking"
268 msgstr "통신에 접속 쀑입니닀."
269 
270@@ -300,4 +323,3 @@ msgstr "\"%s\" 님을 추가할 수 없습니닀."
271 #: ../src/userlist.c:685
272 msgid "The screen name specified is invalid."
273 msgstr "지정한 아읎디가 잘못되었습니닀."
274-
275diff --git a/src/notification.c b/src/notification.c
276index 4376b72..2f5b598 100644
277--- a/src/notification.c
278+++ b/src/notification.c
279@@ -408,6 +408,39 @@ static void lsin_cmd(NateonCmdProc *cmdproc, NateonCommand *cmd)
280        nateon_cmdproc_send(cmdproc, "GLST", NULL);
281 }
282 
283+static void
284+lsin_error(NateonCmdProc *cmdproc, NateonTransaction *trans, int error)
285+{
286+       purple_debug_info("nateon", "%s: ERROR:%d\n", __FUNCTION__, error);
287+       switch (error)
288+       {
289+               case 300:
290+                       nateon_session_set_error(cmdproc->session, NATEON_ERROR_AUTH,
291+                                       _("ID does not exist. Please verify and retry."));
292+                       break;
293+               case 301:
294+                       nateon_session_set_error(cmdproc->session, NATEON_ERROR_AUTH,
295+                                       _("Wrong password. Please verify and retry."));
296+                       break;
297+               case 302:
298+                       nateon_session_set_error(cmdproc->session, NATEON_ERROR_AUTH,
299+                                       _("Already logged in."));
300+                       break;
301+               case 306:
302+                       nateon_session_set_error(cmdproc->session, NATEON_ERROR_SERVCONN,
303+                                       _("Connection is poor. Please retry connecting."));
304+                       break;
305+               case 421:
306+                       nateon_session_set_error(cmdproc->session, NATEON_ERROR_AUTH,
307+                                       _("Nateon server is under maintenance. Please wait and try again."));
308+                       break;
309+               default:
310+                       purple_debug_info("nateon", "%s: Unknown Error %d\n", __FUNCTION__, error);
311+                       nateon_session_set_error(cmdproc->session, NATEON_ERROR_UNKNOWN, NULL);
312+                       break;
313+       }
314+}
315+
316 static void infy_cmd(NateonCmdProc *cmdproc, NateonCommand *cmd)
317 {
318        NateonSession *session = cmdproc->session;
319@@ -1871,6 +1904,7 @@ nateon_notification_init(void)
320 //     nateon_table_add_cmd(cbs_table, "fallback", "XFR", xfr_cmd);
321 //
322        nateon_table_add_error(cbs_table, "RENG", reng_error);
323+       nateon_table_add_error(cbs_table, "LSIN", lsin_error);
324 //     nateon_table_add_error(cbs_table, "ADD", add_error);
325 //     nateon_table_add_error(cbs_table, "REG", reg_error);
326 //     nateon_table_add_error(cbs_table, "RMG", rmg_error);
327diff --git a/src/session.c b/src/session.c
328index 9dfa5b8..6d5caae 100644
329--- a/src/session.c
330+++ b/src/session.c
331@@ -303,9 +303,9 @@ nateon_session_set_error(NateonSession *session, NateonErrorType error,
332 
333        switch (error)
334        {
335-//             case NATEON_ERROR_SERVCONN:
336-//                     msg = g_strdup(info);
337-//                     break;
338+               case NATEON_ERROR_SERVCONN:
339+                       msg = g_strdup(info);
340+                       break;
341 //             case NATEON_ERROR_UNSUPPORTED_PROTOCOL:
342 //                     msg = g_strdup(_("Our protocol is not supported by the "
343 //                                                      "server."));
344diff --git a/src/session.h b/src/session.h
345index 4fd73f4..bb4b92d 100644
346--- a/src/session.h
347+++ b/src/session.h
348@@ -54,7 +54,8 @@ typedef enum
349        NATEON_ERROR_BAD_BLIST,
350        NATEON_ERROR_SIGN_OTHER,
351        NATEON_ERROR_SERV_DOWN,
352-       NATEON_ERROR_SERV_UNAVAILABLE
353+       NATEON_ERROR_SERV_UNAVAILABLE,
354+       NATEON_ERROR_UNKNOWN
355 
356 } NateonErrorType;
357