Mercurial > pidgin.yaz
annotate libpurple/protocols/msn/msnutils.c @ 22551:c65c96e231b5
Printf warning fixes.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 27 Mar 2008 02:09:51 +0000 |
parents | 50e5ac417035 |
children | 5cdd93dac7a2 44159acb7bb7 |
rev | line source |
---|---|
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1 /** |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
2 * @file msnutils.c Utility functions |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
3 * |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
4 * purple |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
5 * |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
6 * Purple is the legal property of its developers, whose names are too numerous |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
8 * source distribution. |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
9 * |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
13 * (at your option) any later version. |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
14 * |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
18 * GNU General Public License for more details. |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
19 * |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
20514
723b5a2f91ce
explicit merge of 'd565bd9a8e62d3302ac14bb7c3a68a52c0c6a65e'
Richard Laager <rlaager@wiktel.com>
parents:
20471
diff
changeset
|
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
23 */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
24 #include "msn.h" |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
25 #include "msnutils.h" |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
26 #include "time.h" |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
27 //#include <openssl/md5.h> |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
28 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
29 char *rand_guid(void); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
30 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
31 /************************************************************************** |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
32 * Util |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
33 **************************************************************************/ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
34 char * |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
35 rand_guid() |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
36 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
37 return g_strdup_printf("%4X%4X-%4X-%4X-%4X-%4X%4X%4X", |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
38 rand() % 0xAAFF + 0x1111, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
39 rand() % 0xAAFF + 0x1111, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
40 rand() % 0xAAFF + 0x1111, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
41 rand() % 0xAAFF + 0x1111, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
42 rand() % 0xAAFF + 0x1111, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
43 rand() % 0xAAFF + 0x1111, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
44 rand() % 0xAAFF + 0x1111, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
45 rand() % 0xAAFF + 0x1111); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
46 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
47 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
48 void |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
49 msn_parse_format(const char *mime, char **pre_ret, char **post_ret) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
50 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
51 char *cur; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
52 GString *pre = g_string_new(NULL); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
53 GString *post = g_string_new(NULL); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
54 unsigned int colors[3]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
55 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
56 if (pre_ret != NULL) *pre_ret = NULL; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
57 if (post_ret != NULL) *post_ret = NULL; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
58 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
59 cur = strstr(mime, "FN="); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
60 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
61 if (cur && (*(cur = cur + 3) != ';')) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
62 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
63 pre = g_string_append(pre, "<FONT FACE=\""); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
64 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
65 while (*cur && *cur != ';') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
66 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
67 pre = g_string_append_c(pre, *cur); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
68 cur++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
69 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
70 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
71 pre = g_string_append(pre, "\">"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
72 post = g_string_prepend(post, "</FONT>"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
73 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
74 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
75 cur = strstr(mime, "EF="); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
76 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
77 if (cur && (*(cur = cur + 3) != ';')) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
78 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
79 while (*cur && *cur != ';') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
80 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
81 pre = g_string_append_c(pre, '<'); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
82 pre = g_string_append_c(pre, *cur); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
83 pre = g_string_append_c(pre, '>'); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
84 post = g_string_prepend_c(post, '>'); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
85 post = g_string_prepend_c(post, *cur); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
86 post = g_string_prepend_c(post, '/'); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
87 post = g_string_prepend_c(post, '<'); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
88 cur++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
89 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
90 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
91 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
92 cur = strstr(mime, "CO="); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
93 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
94 if (cur && (*(cur = cur + 3) != ';')) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
95 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
96 int i; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
97 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
98 i = sscanf(cur, "%02x%02x%02x;", &colors[0], &colors[1], &colors[2]); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
99 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
100 if (i > 0) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
101 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
102 char tag[64]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
103 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
104 if (i == 1) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
105 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
106 colors[1] = 0; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
107 colors[2] = 0; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
108 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
109 else if (i == 2) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
110 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
111 unsigned int temp = colors[0]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
112 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
113 colors[0] = colors[1]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
114 colors[1] = temp; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
115 colors[2] = 0; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
116 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
117 else if (i == 3) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
118 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
119 unsigned int temp = colors[2]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
120 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
121 colors[2] = colors[0]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
122 colors[0] = temp; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
123 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
124 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
125 g_snprintf(tag, sizeof(tag), |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
126 "<FONT COLOR=\"#%02hhx%02hhx%02hhx\">", |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
127 colors[0], colors[1], colors[2]); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
128 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
129 pre = g_string_append(pre, tag); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
130 post = g_string_prepend(post, "</FONT>"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
131 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
132 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
133 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
134 cur = strstr(mime, "RL="); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
135 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
136 if (cur && (*(cur = cur + 3) != ';')) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
137 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
138 if (*cur == '1') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
139 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
140 /* RTL text was received */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
141 pre = g_string_append(pre, "<SPAN style=\"direction:rtl;text-align:right;\">"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
142 post = g_string_prepend(post, "</SPAN>"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
143 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
144 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
145 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
146 cur = g_strdup(purple_url_decode(pre->str)); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
147 g_string_free(pre, TRUE); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
148 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
149 if (pre_ret != NULL) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
150 *pre_ret = cur; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
151 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
152 g_free(cur); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
153 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
154 cur = g_strdup(purple_url_decode(post->str)); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
155 g_string_free(post, TRUE); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
156 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
157 if (post_ret != NULL) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
158 *post_ret = cur; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
159 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
160 g_free(cur); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
161 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
162 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
163 /*encode the str to RFC2047 style |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
164 * Currently only support the UTF-8 and base64 encode |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
165 */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
166 char * |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
167 msn_encode_mime(const char *str) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
168 { |
20990 | 169 gchar *base64, *retval; |
170 | |
171 g_return_val_if_fail(str != NULL, NULL); | |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
172 |
20403
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
173 base64 = purple_base64_encode((guchar *)str, strlen(str)); |
20990 | 174 retval = g_strdup_printf("=?utf-8?B?%s?=", base64); |
175 g_free(base64); | |
176 | |
177 return retval; | |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
178 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
179 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
180 /* |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
181 * We need this because we're only supposed to encode spaces in the font |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
182 * names. purple_url_encode() isn't acceptable. |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
183 */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
184 static const char * |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
185 encode_spaces(const char *str) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
186 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
187 static char buf[BUF_LEN]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
188 const char *c; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
189 char *d; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
190 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
191 g_return_val_if_fail(str != NULL, NULL); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
192 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
193 for (c = str, d = buf; *c != '\0'; c++) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
194 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
195 if (*c == ' ') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
196 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
197 *d++ = '%'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
198 *d++ = '2'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
199 *d++ = '0'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
200 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
201 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
202 *d++ = *c; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
203 } |
22373
50e5ac417035
Patch from Qulogic that fixes #4951 by making sure that the buffer is NUL-
Ka-Hing Cheung <khc@hxbc.us>
parents:
20990
diff
changeset
|
204 *d = '\0'; |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
205 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
206 return buf; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
207 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
208 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
209 /* |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
210 * Taken from the zephyr plugin. |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
211 * This parses HTML formatting (put out by one of the gtkimhtml widgets |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
212 * and converts it to msn formatting. It doesn't deal with the tag closing, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
213 * but gtkimhtml widgets give valid html. |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
214 * It currently deals properly with <b>, <u>, <i>, <font face=...>, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
215 * <font color=...>, <span dir=...>, <span style="direction: ...">. |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
216 * It ignores <font back=...> and <font size=...> |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
217 */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
218 void |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
219 msn_import_html(const char *html, char **attributes, char **message) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
220 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
221 int len, retcount = 0; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
222 const char *c; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
223 char *msg; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
224 char *fontface = NULL; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
225 char fonteffect[4]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
226 char fontcolor[7]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
227 char direction = '0'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
228 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
229 gboolean has_bold = FALSE; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
230 gboolean has_italic = FALSE; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
231 gboolean has_underline = FALSE; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
232 gboolean has_strikethrough = FALSE; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
233 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
234 g_return_if_fail(html != NULL); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
235 g_return_if_fail(attributes != NULL); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
236 g_return_if_fail(message != NULL); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
237 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
238 len = strlen(html); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
239 msg = g_malloc0(len + 1); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
240 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
241 memset(fontcolor, 0, sizeof(fontcolor)); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
242 strcat(fontcolor, "0"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
243 memset(fonteffect, 0, sizeof(fonteffect)); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
244 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
245 for (c = html; *c != '\0';) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
246 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
247 if (*c == '<') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
248 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
249 if (!g_ascii_strncasecmp(c + 1, "br>", 3)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
250 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
251 msg[retcount++] = '\r'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
252 msg[retcount++] = '\n'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
253 c += 4; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
254 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
255 else if (!g_ascii_strncasecmp(c + 1, "i>", 2)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
256 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
257 if (!has_italic) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
258 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
259 strcat(fonteffect, "I"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
260 has_italic = TRUE; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
261 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
262 c += 3; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
263 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
264 else if (!g_ascii_strncasecmp(c + 1, "b>", 2)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
265 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
266 if (!has_bold) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
267 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
268 strcat(fonteffect, "B"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
269 has_bold = TRUE; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
270 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
271 c += 3; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
272 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
273 else if (!g_ascii_strncasecmp(c + 1, "u>", 2)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
274 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
275 if (!has_underline) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
276 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
277 strcat(fonteffect, "U"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
278 has_underline = TRUE; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
279 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
280 c += 3; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
281 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
282 else if (!g_ascii_strncasecmp(c + 1, "s>", 2)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
283 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
284 if (!has_strikethrough) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
285 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
286 strcat(fonteffect, "S"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
287 has_strikethrough = TRUE; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
288 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
289 c += 3; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
290 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
291 else if (!g_ascii_strncasecmp(c + 1, "a href=\"", 8)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
292 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
293 c += 9; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
294 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
295 if (!g_ascii_strncasecmp(c, "mailto:", 7)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
296 c += 7; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
297 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
298 while ((*c != '\0') && g_ascii_strncasecmp(c, "\">", 2)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
299 msg[retcount++] = *c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
300 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
301 if (*c != '\0') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
302 c += 2; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
303 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
304 /* ignore descriptive string */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
305 while ((*c != '\0') && g_ascii_strncasecmp(c, "</a>", 4)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
306 c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
307 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
308 if (*c != '\0') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
309 c += 4; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
310 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
311 else if (!g_ascii_strncasecmp(c + 1, "span", 4)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
312 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
313 /* Bi-directional text support using CSS properties in span tags */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
314 c += 5; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
315 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
316 while (*c != '\0' && *c != '>') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
317 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
318 while (*c == ' ') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
319 c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
320 if (!g_ascii_strncasecmp(c, "dir=\"rtl\"", 9)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
321 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
322 c += 9; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
323 direction = '1'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
324 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
325 else if (!g_ascii_strncasecmp(c, "style=\"", 7)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
326 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
327 /* Parse inline CSS attributes */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
328 char *attributes; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
329 int attr_len = 0; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
330 c += 7; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
331 while (*(c + attr_len) != '\0' && *(c + attr_len) != '"') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
332 attr_len++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
333 if (*(c + attr_len) == '"') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
334 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
335 char *attr_dir; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
336 attributes = g_strndup(c, attr_len); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
337 attr_dir = purple_markup_get_css_property(attributes, "direction"); |
20461
25542d5c94ed
propagate from branch 'im.pidgin.pidgin' (head 007693114b23cd2711c1cb9030a148e2f63de8c8)
Ka-Hing Cheung <khc@hxbc.us>
parents:
20424
diff
changeset
|
338 if (attr_dir && (!g_ascii_strncasecmp(attr_dir, "RTL", 3))) |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
339 direction = '1'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
340 g_free(attr_dir); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
341 g_free(attributes); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
342 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
343 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
344 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
345 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
346 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
347 c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
348 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
349 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
350 if (*c == '>') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
351 c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
352 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
353 else if (!g_ascii_strncasecmp(c + 1, "font", 4)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
354 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
355 c += 5; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
356 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
357 while ((*c != '\0') && !g_ascii_strncasecmp(c, " ", 1)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
358 c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
359 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
360 if (!g_ascii_strncasecmp(c, "color=\"#", 7)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
361 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
362 c += 8; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
363 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
364 fontcolor[0] = *(c + 4); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
365 fontcolor[1] = *(c + 5); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
366 fontcolor[2] = *(c + 2); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
367 fontcolor[3] = *(c + 3); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
368 fontcolor[4] = *c; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
369 fontcolor[5] = *(c + 1); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
370 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
371 c += 8; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
372 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
373 else if (!g_ascii_strncasecmp(c, "face=\"", 6)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
374 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
375 const char *end = NULL; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
376 const char *comma = NULL; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
377 unsigned int namelen = 0; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
378 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
379 c += 6; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
380 end = strchr(c, '\"'); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
381 comma = strchr(c, ','); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
382 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
383 if (comma == NULL || comma > end) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
384 namelen = (unsigned int)(end - c); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
385 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
386 namelen = (unsigned int)(comma - c); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
387 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
388 fontface = g_strndup(c, namelen); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
389 c = end + 2; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
390 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
391 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
392 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
393 /* Drop all unrecognized/misparsed font tags */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
394 while ((*c != '\0') && g_ascii_strncasecmp(c, "\">", 2)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
395 c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
396 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
397 if (*c != '\0') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
398 c += 2; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
399 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
400 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
401 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
402 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
403 while ((*c != '\0') && (*c != '>')) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
404 c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
405 if (*c != '\0') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
406 c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
407 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
408 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
409 else if (*c == '&') |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
410 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
411 if (!g_ascii_strncasecmp(c, "<", 4)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
412 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
413 msg[retcount++] = '<'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
414 c += 4; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
415 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
416 else if (!g_ascii_strncasecmp(c, ">", 4)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
417 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
418 msg[retcount++] = '>'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
419 c += 4; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
420 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
421 else if (!g_ascii_strncasecmp(c, " ", 6)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
422 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
423 msg[retcount++] = ' '; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
424 c += 6; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
425 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
426 else if (!g_ascii_strncasecmp(c, """, 6)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
427 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
428 msg[retcount++] = '"'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
429 c += 6; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
430 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
431 else if (!g_ascii_strncasecmp(c, "&", 5)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
432 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
433 msg[retcount++] = '&'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
434 c += 5; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
435 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
436 else if (!g_ascii_strncasecmp(c, "'", 6)) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
437 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
438 msg[retcount++] = '\''; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
439 c += 6; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
440 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
441 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
442 msg[retcount++] = *c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
443 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
444 else |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
445 msg[retcount++] = *c++; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
446 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
447 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
448 if (fontface == NULL) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
449 fontface = g_strdup("MS Sans Serif"); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
450 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
451 *attributes = g_strdup_printf("FN=%s; EF=%s; CO=%s; PF=0; RL=%c", |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
452 encode_spaces(fontface), |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
453 fonteffect, fontcolor, direction); |
20983
64644b98c20c
Avoid unnecessary alloc/free.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
20514
diff
changeset
|
454 *message = msg; |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
455 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
456 g_free(fontface); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
457 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
458 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
459 void |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
460 msn_parse_socket(const char *str, char **ret_host, int *ret_port) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
461 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
462 char *host; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
463 char *c; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
464 int port; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
465 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
466 host = g_strdup(str); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
467 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
468 if ((c = strchr(host, ':')) != NULL){ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
469 *c = '\0'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
470 port = atoi(c + 1); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
471 }else{ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
472 port = 1863; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
473 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
474 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
475 *ret_host = host; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
476 *ret_port = port; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
477 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
478 /*************************************************************************** |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
479 * MSN Time Related Funciton |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
480 ***************************************************************************/ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
481 #if 0 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
482 int |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
483 msn_convert_iso8601(const char *timestr,struct tm tm_time) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
484 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
485 char temp[64]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
486 struct tm ctime; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
487 time_t ts; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
488 |
20471
530a92d50c5e
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20461
diff
changeset
|
489 purple_debug_info("MSNP14","convert string is{%s}\n",timestr); |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
490 tzset(); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
491 /*copy string first*/ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
492 memset(temp, 0, sizeof(temp)); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
493 strncpy(temp, timestr, strlen(timestr)); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
494 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
495 /*convert via strptime()*/ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
496 memset(&ctime, 0, sizeof(struct tm)); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
497 strptime(temp, "%d %b %Y %T %Z", &ctime); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
498 ts = mktime(&ctime) - timezone; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
499 localtime_r(&ts, tm_time); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
500 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
501 #endif |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
502 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
503 /*************************************************************************** |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
504 * MSN Challenge Computing Function |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
505 ***************************************************************************/ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
506 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
507 /* |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
508 * Handle MSN Chanllege computation |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
509 *This algorithm reference with http://msnpiki.msnfanatic.com/index.php/MSNP11:Challenges |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
510 */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
511 #define BUFSIZE 256 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
512 void |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
513 msn_handle_chl(char *input, char *output) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
514 { |
20403
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
515 PurpleCipher *cipher; |
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
516 PurpleCipherContext *context; |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
517 char *productKey = MSNP13_WLM_PRODUCT_KEY, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
518 *productID = MSNP13_WLM_PRODUCT_ID, |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
519 *hexChars = "0123456789abcdef", |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
520 buf[BUFSIZE]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
521 unsigned char md5Hash[16], *newHash; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
522 unsigned int *md5Parts, *chlStringParts, newHashParts[5]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
523 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
524 long long nHigh=0, nLow=0; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
525 |
20424
b462ef222d28
Use glib functions for endian conversion. If someone has a big endian
Stu Tomlinson <stu@nosnilmot.com>
parents:
20421
diff
changeset
|
526 int i; |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
527 |
20403
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
528 /* Create the MD5 hash by using Purple MD5 algorithm*/ |
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
529 cipher = purple_ciphers_find_cipher("md5"); |
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
530 context = purple_cipher_context_new(cipher, NULL); |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
531 |
20403
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
532 purple_cipher_context_append(context, (const guchar *)input, |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
533 strlen(input)); |
20403
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
534 purple_cipher_context_append(context, (const guchar *)productKey, |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
535 strlen(productKey)); |
20403
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
536 purple_cipher_context_digest(context, sizeof(md5Hash), md5Hash, NULL); |
599b5a4aebab
The last of the merge fix-ups.
Richard Laager <rlaager@wiktel.com>
parents:
20400
diff
changeset
|
537 purple_cipher_context_destroy(context); |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
538 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
539 /* Split it into four integers */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
540 md5Parts = (unsigned int *)md5Hash; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
541 for(i=0; i<4; i++){ |
20424
b462ef222d28
Use glib functions for endian conversion. If someone has a big endian
Stu Tomlinson <stu@nosnilmot.com>
parents:
20421
diff
changeset
|
542 /* adjust endianess */ |
b462ef222d28
Use glib functions for endian conversion. If someone has a big endian
Stu Tomlinson <stu@nosnilmot.com>
parents:
20421
diff
changeset
|
543 md5Parts[i] = GUINT_TO_LE(md5Parts[i]); |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
544 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
545 /* & each integer with 0x7FFFFFFF */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
546 /* and save one unmodified array for later */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
547 newHashParts[i] = md5Parts[i]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
548 md5Parts[i] &= 0x7FFFFFFF; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
549 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
550 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
551 /* make a new string and pad with '0' */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
552 snprintf(buf, BUFSIZE-5, "%s%s", input, productID); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
553 i = strlen(buf); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
554 memset(&buf[i], '0', 8 - (i % 8)); |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
555 buf[i + (8 - (i % 8))]='\0'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
556 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
557 /* split into integers */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
558 chlStringParts = (unsigned int *)buf; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
559 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
560 /* this is magic */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
561 for (i=0; i<(strlen(buf)/4)-1; i+=2){ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
562 long long temp; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
563 |
20424
b462ef222d28
Use glib functions for endian conversion. If someone has a big endian
Stu Tomlinson <stu@nosnilmot.com>
parents:
20421
diff
changeset
|
564 chlStringParts[i] = GUINT_TO_LE(chlStringParts[i]); |
b462ef222d28
Use glib functions for endian conversion. If someone has a big endian
Stu Tomlinson <stu@nosnilmot.com>
parents:
20421
diff
changeset
|
565 chlStringParts[i+1] = GUINT_TO_LE(chlStringParts[i+1]); |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
566 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
567 temp=(md5Parts[0] * (((0x0E79A9C1 * (long long)chlStringParts[i]) % 0x7FFFFFFF)+nHigh) + md5Parts[1])%0x7FFFFFFF; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
568 nHigh=(md5Parts[2] * (((long long)chlStringParts[i+1]+temp) % 0x7FFFFFFF) + md5Parts[3]) % 0x7FFFFFFF; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
569 nLow=nLow + nHigh + temp; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
570 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
571 nHigh=(nHigh+md5Parts[1]) % 0x7FFFFFFF; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
572 nLow=(nLow+md5Parts[3]) % 0x7FFFFFFF; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
573 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
574 newHashParts[0]^=nHigh; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
575 newHashParts[1]^=nLow; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
576 newHashParts[2]^=nHigh; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
577 newHashParts[3]^=nLow; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
578 |
20424
b462ef222d28
Use glib functions for endian conversion. If someone has a big endian
Stu Tomlinson <stu@nosnilmot.com>
parents:
20421
diff
changeset
|
579 /* adjust endianness */ |
b462ef222d28
Use glib functions for endian conversion. If someone has a big endian
Stu Tomlinson <stu@nosnilmot.com>
parents:
20421
diff
changeset
|
580 for(i=0; i<4; i++) |
b462ef222d28
Use glib functions for endian conversion. If someone has a big endian
Stu Tomlinson <stu@nosnilmot.com>
parents:
20421
diff
changeset
|
581 newHashParts[i] = GUINT_TO_LE(newHashParts[i]); |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
582 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
583 /* make a string of the parts */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
584 newHash = (unsigned char *)newHashParts; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
585 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
586 /* convert to hexadecimal */ |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
587 for (i=0; i<16; i++) |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
588 { |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
589 output[i*2]=hexChars[(newHash[i]>>4)&0xF]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
590 output[(i*2)+1]=hexChars[newHash[i]&0xF]; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
591 } |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
592 |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
593 output[32]='\0'; |
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
594 |
20471
530a92d50c5e
Misc cleanups, better error handling, and print the Address Book received from the server in a human readable way.
Carlos Silva <typ0@pidgin.im>
parents:
20461
diff
changeset
|
595 // purple_debug_info("MSNP14","chl output{%s}\n",output); |
20400
ea9a5566a156
propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-sf-1621854-4' (head 36b8a3e05397b5918f311a046fa580c5bb8846e0)
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
596 } |