]> git.pld-linux.org Git - packages/gg2.git/blob - gg2-orange.patch
- release 2.1,
[packages/gg2.git] / gg2-orange.patch
1 diff -aurN gg2-2.2.8/src/plugins/sms/sms_core.c gg2-2.2.8.cvs/src/plugins/sms/sms_core.c
2 --- gg2-2.2.8/src/plugins/sms/sms_core.c        2005-09-01 16:49:47.000000000 +0200
3 +++ gg2-2.2.8.cvs/src/plugins/sms/sms_core.c    2005-09-24 05:44:20.000000000 +0200
4 @@ -1,4 +1,4 @@
5 -/* $Id$ */
6 +/* $Id$ */
7  
8  /*
9   * SMS plugin for GNU Gadu 2
10 @@ -47,7 +47,7 @@
11  #include "sms_gui.h"
12  #include "sms_core.h"
13  
14 -extern char *idea_token_path;
15 +extern char *orange_token_path;
16  extern gint method;
17  
18  /* URLencoding code by Ahmad Baitalmal <ahmad@bitbuilder.com>
19 @@ -93,7 +93,7 @@
20         return new_string;
21  }
22  
23 -/* laczenie sie z wybranym hostem, zwraca -1 przy b³edzie, inaczej 0 */
24 +/* laczenie sie z wybranym hostem, zwraca -1 przy błedzie, inaczej 0 */
25  gint sms_connect(gchar * sms_info, gchar * sms_host, int *sock_s)
26  {
27         struct hostent *h;
28 @@ -182,19 +182,19 @@
29         g_free(message->number);
30         g_free(message->sender);
31         g_free(message->body);
32 -       g_free(message->idea_token);
33 -       g_free(message->idea_pass);
34 +       g_free(message->orange_token);
35 +       g_free(message->orange_pass);
36         g_free(message);
37  
38         return;
39  }
40  
41  /* tu bedzie wymiana na cos innego, GUI musi to obslugiwac a nie "samowolka" ;-) */
42 -gboolean IDEA_logo(SMS * user_data)
43 +gboolean ORANGE_logo(SMS * user_data)
44  {
45 -       GGaduDialog *dialog = ggadu_dialog_new_full(GGADU_DIALOG_GENERIC, _("IDEA token"), "get token", user_data);
46 +       GGaduDialog *dialog = ggadu_dialog_new_full(GGADU_DIALOG_GENERIC, _("ORANGE token"), "get token", user_data);
47         
48 -       ggadu_dialog_add_entry(dialog, 0, "", VAR_IMG, idea_token_path, VAR_FLAG_NONE);
49 +       ggadu_dialog_add_entry(dialog, 0, "", VAR_IMG, orange_token_path, VAR_FLAG_NONE);
50         ggadu_dialog_add_entry(dialog, 1, _("Enter token text"), VAR_STR, NULL, VAR_FLAG_NONE);
51  
52         signal_emit_from_thread("sms", "gui show dialog", dialog, "main-gui");
53 @@ -240,7 +240,7 @@
54  }
55  
56  /* wyslanie na idee */
57 -gint send_IDEA(SMS * message)
58 +gint send_ORANGE(SMS * message)
59  {
60         gchar *token = NULL;
61         gchar temp[2];
62 @@ -248,20 +248,20 @@
63         gchar *recv_buff = NULL;
64         gchar *buf = NULL;
65         gint i = 0, j, k, retries = 3;
66 -       FILE *idea_logo;
67 +       FILE *orange_logo;
68         HTTPstruct *HTTP = NULL;
69         SMS *message2 = NULL;
70         int sock_s;
71  
72         HTTP = httpstruct_new();
73         HTTP->method = SMS_METHOD_GET;
74 -       HTTP->host = g_strdup(GGADU_SMS_IDEA_HOST);
75 -       HTTP->url = g_strdup(GGADU_SMS_IDEA_URL_GET);
76 +       HTTP->host = g_strdup(GGADU_SMS_ORANGE_HOST);
77 +       HTTP->url = g_strdup(GGADU_SMS_ORANGE_URL_GET);
78         HTTP->url_params = g_strdup(" ");
79  
80        get_mainpage:
81         /* pobranie adresu do obrazka */
82 -       if (sms_connect("IDEA", "213.218.116.131", &sock_s))
83 +       if (sms_connect("ORANGE", "213.218.116.131", &sock_s))
84         {
85                 httpstruct_free(HTTP);
86                 return ERR_SERVICE;
87 @@ -277,7 +277,7 @@
88  
89         close(sock_s);
90  
91 -       print_debug("\n=======retries left: %d=====\nIDEA RECVBUFF1: %s\n\n", retries - 1, recv_buff);
92 +       print_debug("\n=======retries left: %d=====\nORANGE RECVBUFF1: %s\n\n", retries - 1, recv_buff);
93  
94         if (!g_strstr_len(recv_buff, i, "200 OK"))
95         {
96 @@ -301,13 +301,13 @@
97                 return ERR_READ_TOKEN;
98         }
99  
100 -       if (!(token = g_strndup(buf + 24, GGADU_SMS_IDEA_TOKENLEN)))
101 +       if (!(token = g_strndup(buf + 24, GGADU_SMS_ORANGE_TOKENLEN)))
102         {
103                 g_free(recv_buff);
104                 return ERR_READ_TOKEN;
105         }
106  
107 -       if (strlen(token) < GGADU_SMS_IDEA_TOKENLEN)
108 +       if (strlen(token) < GGADU_SMS_ORANGE_TOKENLEN)
109         {
110                 g_free(token);
111                 g_free(recv_buff);
112 @@ -319,12 +319,12 @@
113  
114         HTTP = httpstruct_new();
115         HTTP->method = SMS_METHOD_GET;
116 -       HTTP->host = g_strdup(GGADU_SMS_IDEA_HOST);
117 +       HTTP->host = g_strdup(GGADU_SMS_ORANGE_HOST);
118         HTTP->url = g_strdup(gettoken);
119         HTTP->url_params = g_strdup(" ");
120  
121        get_token:
122 -       if (sms_connect("IDEA", GGADU_SMS_IDEA_HOST, &sock_s))
123 +       if (sms_connect("ORANGE", GGADU_SMS_ORANGE_HOST, &sock_s))
124         {
125                 httpstruct_free(HTTP);
126                 return ERR_SERVICE;
127 @@ -340,7 +340,7 @@
128  
129         close(sock_s);
130  
131 -       print_debug("\n============retries left: %d=================\nIDEA RECVBUFF2: %s\n\n", retries, recv_buff);
132 +       print_debug("\n============retries left: %d=================\nORANGE RECVBUFF2: %s\n\n", retries, recv_buff);
133  
134         if (!g_strstr_len(recv_buff, i, "200 OK"))
135         {
136 @@ -379,8 +379,8 @@
137                 recv_buff[k] = recv_buff[k + j];
138         recv_buff[k] = 0;
139  
140 -       /* oops, bail out if idea_token_path cannot be written. */
141 -       if (!(idea_logo = fopen(idea_token_path, "w")))
142 +       /* oops, bail out if orange_token_path cannot be written. */
143 +       if (!(orange_logo = fopen(orange_token_path, "w")))
144         {
145                 g_free(token);
146                 g_free(recv_buff);
147 @@ -388,8 +388,8 @@
148         }
149  
150         /* write token image to file, close fd */
151 -       fwrite(recv_buff, 1, i - j, idea_logo);
152 -       fclose(idea_logo);
153 +       fwrite(recv_buff, 1, i - j, orange_logo);
154 +       fclose(orange_logo);
155  
156         g_free(recv_buff);
157  
158 @@ -399,15 +399,15 @@
159         message2->sender = g_strdup(message->sender);
160         message2->body = g_strdup(message->body);
161  
162 -       message2->idea_token = token;
163 -       message2->idea_pass = NULL;
164 +       message2->orange_token = token;
165 +       message2->orange_pass = NULL;
166  
167 -       IDEA_logo(message2);
168 +       ORANGE_logo(message2);
169  
170         return TRUE;
171  }
172  
173 -gpointer send_IDEA_stage2(SMS * message)
174 +gpointer send_ORANGE_stage2(SMS * message)
175  {
176         gchar *recv_buff = NULL;
177         gchar *post = NULL;
178 @@ -420,7 +420,7 @@
179         int sock_s;
180  
181         /* is there any better place for this? */
182 -       unlink(idea_token_path);
183 +       unlink(orange_token_path);
184  
185         if (!message)
186         {
187 @@ -428,7 +428,7 @@
188                 goto out;
189         }
190  
191 -       if (!message->idea_pass)
192 +       if (!message->orange_pass)
193         {
194                 sms_warning(message->number, _("Please enter token"));
195                 goto out;
196 @@ -446,8 +446,8 @@
197  
198         sender = ggadu_sms_urlencode(g_strdup(message->sender));
199         body = ggadu_sms_urlencode(g_strdup(message->body));
200 -       post = g_strconcat("token=", message->idea_token, "&SENDER=", sender, "&RECIPIENT=", sms_number, "&SHORT_MESSAGE=", body, "&pass=",
201 -                          message->idea_pass, "&respInfo=2", NULL);
202 +       post = g_strconcat("token=", message->orange_token, "&SENDER=", sender, "&RECIPIENT=", sms_number, "&SHORT_MESSAGE=", body, "&pass=",
203 +                          message->orange_pass, "&respInfo=2", NULL);
204  
205         g_free(sender);
206         g_free(body);
207 @@ -456,15 +456,15 @@
208  
209         HTTP = httpstruct_new();
210         HTTP->method = SMS_METHOD_POST;
211 -       HTTP->host = g_strdup(GGADU_SMS_IDEA_HOST);
212 -       HTTP->url = g_strdup(GGADU_SMS_IDEA_URL_SEND);
213 +       HTTP->host = g_strdup(GGADU_SMS_ORANGE_HOST);
214 +       HTTP->url = g_strdup(GGADU_SMS_ORANGE_URL_SEND);
215         HTTP->url_params = g_strdup(" ");
216         HTTP->post_data = g_strdup(post);
217         HTTP->post_length = strlen(post);
218         g_free(post);
219  
220        send_sms:
221 -       if (sms_connect("IDEA", "213.218.116.131", &sock_s))
222 +       if (sms_connect("ORANGE", "213.218.116.131", &sock_s))
223         {
224                 sms_warning(message->number, _("Cannot connect!"));
225                 httpstruct_free(HTTP);
226 @@ -480,7 +480,7 @@
227  
228         close(sock_s);
229  
230 -       print_debug("\n============retries left: %d===================\nIDEA RECVBUFF3: %s\n\n", retries, recv_buff);
231 +       print_debug("\n============retries left: %d===================\nORANGE RECVBUFF3: %s\n\n", retries, recv_buff);
232  
233         if (!g_strstr_len(recv_buff, i, "200 OK"))
234         {
235 @@ -498,10 +498,10 @@
236                 httpstruct_free(HTTP);
237         }
238  
239 -       if (g_strstr_len(recv_buff, i, "SMS zosta³ wys³any"))
240 +       if (g_strstr_len(recv_buff, i, "SMS został wysłany"))
241                 sms_message(message->number, _("SMS has been sent"));
242  
243 -       else if (g_strstr_len(recv_buff, i, "Podano b³êdne has³o, SMS nie zosta³ wys³any"))
244 +       else if (g_strstr_len(recv_buff, i, "Podano błędne hasło, SMS nie został wysłany"))
245                 sms_warning(message->number, _("Bad token!"));
246  
247         else if (g_strstr_len(recv_buff, i, "Object moved"))
248 @@ -513,7 +513,7 @@
249         else if (g_strstr_len(recv_buff, i, "serwis chwilowo"))
250                 sms_warning(message->number, _("Gateway error!"));
251  
252 -       else if (g_strstr_len(recv_buff, i, "nie ma aktywnej us³ugi"))
253 +       else if (g_strstr_len(recv_buff, i, "nie ma aktywnej usługi"))
254                 sms_warning(message->number, _("Service not activated!"));
255  
256         else if (g_strstr_len(recv_buff, i, "adres odbiorcy wiadomosci jest nieprawid"))
257 @@ -591,11 +591,11 @@
258  
259         if (!strlen(recv_buff))
260                 ret = ERR_SERVICE;
261 -       else if (g_strstr_len(recv_buff, i, "wiadomo¶æ zosta³a wys³ana na numer"))
262 +       else if (g_strstr_len(recv_buff, i, "wiadomość została wysłana na numer"))
263                 ret = TRUE;
264 -       else if (g_strstr_len(recv_buff, i, "podano z³y numer"))
265 +       else if (g_strstr_len(recv_buff, i, "podano zły numer"))
266                 ret = ERR_BAD_RCPT;
267 -       else if (g_strstr_len(recv_buff, i, "Z powodu przekroczenia limitów bramki"))
268 +       else if (g_strstr_len(recv_buff, i, "Z powodu przekroczenia limitów bramki"))
269                 ret = ERR_LIMIT_EX;
270  
271         g_free(recv_buff);
272 @@ -739,7 +739,7 @@
273                 return FALSE;
274  
275         if (*sms_number == '5')
276 -               return SMS_IDEA;
277 +               return SMS_ORANGE;
278  
279         if (*sms_number == '6')
280         {
281 @@ -789,14 +789,14 @@
282         gsm_oper = check_operator(message->number);
283         switch (gsm_oper)
284         {
285 -       case SMS_IDEA:
286 +       case SMS_ORANGE:
287                 if (message->external)
288                 {
289                         result = system(g_strconcat("sms ", message->number, " \"", message->body, " ", message->sender, "\"", NULL));
290                         goto out;
291                 }
292                 else
293 -                       result = send_IDEA(message);
294 +                       result = send_ORANGE(message);
295  
296                 break;
297  
298 @@ -846,8 +846,8 @@
299         {
300                 /* successes */
301         case TRUE:
302 -               /* dirty IDEA workaround: we can't handle send_idea*() return values here,
303 -                  send_idea*() eventually notifies about success itself. */
304 +               /* dirty ORANGE workaround: we can't handle send_orange*() return values here,
305 +                  send_orange*() eventually notifies about success itself. */
306                 if (gsm_oper == SMS_PLUS)
307                         sms_message(message->number, _("SMS has been sent"));
308                 else if (gsm_oper == SMS_ERA)
309 diff -aurN gg2-2.2.8/src/plugins/sms/sms_core.h gg2-2.2.8.cvs/src/plugins/sms/sms_core.h
310 --- gg2-2.2.8/src/plugins/sms/sms_core.h        2005-09-01 16:49:47.000000000 +0200
311 +++ gg2-2.2.8.cvs/src/plugins/sms/sms_core.h    2005-09-24 05:44:20.000000000 +0200
312 @@ -1,4 +1,4 @@
313 -/* $Id$ */
314 +/* $Id$ */
315  
316  /* 
317   * SMS plugin for GNU Gadu 2 
318 @@ -27,9 +27,9 @@
319  #define GGADU_SMS_PLUS_HOST            "www.text.plusgsm.pl"
320  #define GGADU_SMS_PLUS_URL             "/sms/sendsms.php"
321  
322 -#define GGADU_SMS_IDEA_HOST            "sms.idea.pl"
323 -#define GGADU_SMS_IDEA_URL_GET                 "/"
324 -#define GGADU_SMS_IDEA_URL_SEND                "/sendsms.aspx"
325 +#define GGADU_SMS_ORANGE_HOST          "sms.orange.pl"
326 +#define GGADU_SMS_ORANGE_URL_GET       "/Default.aspx?id=A2B6173D-CF1A-4c38-B7A7-E3144D43D70C"
327 +#define GGADU_SMS_ORANGE_URL_SEND      "/sendsms.aspx"
328  
329  #define GGADU_SMS_ERA_HOST     "www.eraomnix.pl"
330  #define GGADU_SMS_ERA_URL      "/msg/api/do/tinker/sponsored"
331 @@ -56,13 +56,13 @@
332  
333  #define GGADU_SMS_RECVBUFF_LEN 32768
334  
335 -#define IDEA_GFX "/idea_token.gfx"
336 -#define GGADU_SMS_IDEA_TOKENLEN 36
337 +#define ORANGE_GFX "/orange_token.gfx"
338 +#define GGADU_SMS_ORANGE_TOKENLEN 36
339  #define RESERVED_CHARS "!\"'()*+-.<>[]\\^_`{}|~\t#;/?:&=+,$% \r\n\v\x7f"
340  
341  enum
342  {
343 -       SMS_IDEA = 2,
344 +       SMS_ORANGE = 2,
345         SMS_ERA,
346         SMS_PLUS
347  };
348 @@ -116,12 +116,12 @@
349         gchar *sender;          /* free() me */
350         gchar *era_login;
351         gchar *era_password;
352 -       gchar *idea_token;      /* free() me */
353 -       gchar *idea_pass;       /* free() me */
354 +       gchar *orange_token;    /* free() me */
355 +       gchar *orange_pass;     /* free() me */
356  } SMS;
357  
358  gpointer send_sms(SMS * message);
359 -gpointer send_IDEA_stage2(SMS * message);
360 +gpointer send_ORANGE_stage2(SMS * message);
361  
362  void sms_message(const gchar * sms_number, const gchar * message);
363  void sms_warning(const gchar * sms_number, const gchar * warning);
364 diff -aurN gg2-2.2.8/src/plugins/sms/sms_gui.c gg2-2.2.8.cvs/src/plugins/sms/sms_gui.c
365 --- gg2-2.2.8/src/plugins/sms/sms_gui.c 2005-01-19 22:02:18.000000000 +0100
366 +++ gg2-2.2.8.cvs/src/plugins/sms/sms_gui.c     2005-09-24 05:43:21.000000000 +0200
367 @@ -1,4 +1,4 @@
368 -/* $Id$ */
369 +/* $Id$ */
370  
371  /*
372   * SMS plugin for GNU Gadu 2
373 @@ -43,7 +43,7 @@
374  
375  GGaduPlugin *sms_handler;
376  GSList *smslist = NULL;
377 -gchar *idea_token_path = NULL;
378 +gchar *orange_token_path = NULL;
379  gint method;
380  
381  GGaduProtocol *p;
382 @@ -200,7 +200,7 @@
383         if (!ggadu_config_read(sms_handler))
384                 g_warning(_("Unable to read config file for plugin sms"));
385  
386 -       idea_token_path = g_build_filename(config->configdir, IDEA_GFX, NULL);
387 +       orange_token_path = g_build_filename(config->configdir, ORANGE_GFX, NULL);
388  
389         register_signal_receiver((GGaduPlugin *) sms_handler, (signal_func_ptr) signal_receive);
390  
391 @@ -479,11 +479,11 @@
392                         {
393                                 GGaduKeyValue *kv = (GGaduKeyValue *) tmplist->data;
394                                 if (kv->key == 1)
395 -                                       message->idea_pass = g_strdup(kv->value);
396 +                                       message->orange_pass = g_strdup(kv->value);
397                                         
398                                 tmplist = tmplist->next;
399                         }
400 -                       g_thread_create((gpointer(*)())send_IDEA_stage2, message, FALSE, NULL);
401 +                       g_thread_create((gpointer(*)())send_ORANGE_stage2, message, FALSE, NULL);
402                 }
403                 
404                 GGaduDialog_free(dialog);
405 @@ -569,7 +569,7 @@
406         signal_emit(GGadu_PLUGIN_NAME, "gui unregister protocol", p, "main-gui");
407         ggadu_menu_free(menu_smsmenu);
408  
409 -       g_free(idea_token_path);
410 +       g_free(orange_token_path);
411  }
412  
413  /* zapis listy numerow do pliku */
This page took 0.082518 seconds and 3 git commands to generate.