annotate src/protocols/msn/utils.c @ 6853:63261dc7aa25

[gaim-migrate @ 7398] *** empty log message *** committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Mon, 15 Sep 2003 22:12:32 +0000
parents b7e113a59b51
children 67f9b43c402a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
5312
89948fedf782 [gaim-migrate @ 5684]
Christian Hammond <chipx86@chipx86.com>
parents: 5309
diff changeset
2 * @file utils.c Utility functions
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 * gaim
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
6701
b7e113a59b51 [gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents: 6359
diff changeset
7 *
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * (at your option) any later version.
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * GNU General Public License for more details.
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 */
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 #include "msn.h"
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 char *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 msn_url_decode(const char *str)
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 static char buf[MSN_BUF_LEN];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 int i, j = 0;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 char *bum;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 g_return_val_if_fail(str != NULL, NULL);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 for (i = 0; i < strlen(str); i++) {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 char hex[3];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 if (str[i] != '%')
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 buf[j++] = str[i];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 else {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 strncpy(hex, str + ++i, 2);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 hex[2] = '\0';
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 /* i is pointing to the start of the number */
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 i++;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 /*
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 * Now it's at the end and at the start of the for loop
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 * will be at the next character.
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 */
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 buf[j++] = strtol(hex, NULL, 16);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 buf[j] = '\0';
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 if (!g_utf8_validate(buf, -1, (const char **)&bum))
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 *bum = '\0';
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 return buf;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 char *
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 msn_url_encode(const char *str)
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 static char buf[MSN_BUF_LEN];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 int i, j = 0;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 g_return_val_if_fail(str != NULL, NULL);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 for (i = 0; i < strlen(str); i++) {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 if (isalnum(str[i]))
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 buf[j++] = str[i];
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 else {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 sprintf(buf + j, "%%%02x", (unsigned char)str[i]);
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 j += 3;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 buf[j] = '\0';
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 return buf;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
83 void
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
84 msn_parse_format(const char *mime, char **pre_ret, char **post_ret)
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 char *cur;
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
87 GString *pre = g_string_new(NULL);
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
88 GString *post = g_string_new(NULL);
6093
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
89 unsigned int colors[3];
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
91 if (pre_ret != NULL) *pre_ret = NULL;
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
92 if (post_ret != NULL) *post_ret = NULL;
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
93
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 cur = strstr(mime, "FN=");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 if (cur && (*(cur = cur + 3) != ';')) {
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
97 pre = g_string_append(pre, "<FONT FACE=\"");
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 while (*cur && *cur != ';') {
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
100 pre = g_string_append_c(pre, *cur);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101 cur++;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
104 pre = g_string_append(pre, "\">");
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
105 post = g_string_prepend(post, "</FONT>");
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 }
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
107
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 cur = strstr(mime, "EF=");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 if (cur && (*(cur = cur + 3) != ';')) {
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 while (*cur && *cur != ';') {
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
112 pre = g_string_append_c(pre, '<');
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
113 pre = g_string_append_c(pre, *cur);
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
114 pre = g_string_append_c(pre, '>');
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 cur++;
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 cur = strstr(mime, "CO=");
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 if (cur && (*(cur = cur + 3) != ';')) {
6093
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
122 int i;
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
123
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
124 i = sscanf(cur, "%02x%02x%02x;", &colors[0], &colors[1], &colors[2]);
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
125
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
126 if (i > 0) {
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 char tag[64];
6093
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
128
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
129 if (i == 1) {
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
130 colors[2] = colors[0];
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
131 colors[1] = 0;
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
132 colors[0] = 0;
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
133 }
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
134 else if (i == 2) {
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
135 colors[2] = colors[1];
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
136 colors[1] = colors[0];
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
137 colors[0] = 0;
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
138 }
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
139
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 g_snprintf(tag, sizeof(tag),
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141 "<FONT COLOR=\"#%02hhx%02hhx%02hhx\">",
6093
13a37cacd10b [gaim-migrate @ 6552]
Christian Hammond <chipx86@chipx86.com>
parents: 5964
diff changeset
142 colors[2], colors[1], colors[0]);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
144 pre = g_string_append(pre, tag);
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
145 post = g_string_prepend(post, "</FONT>");
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147 }
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148
6359
dfde69e105ae [gaim-migrate @ 6863]
Christian Hammond <chipx86@chipx86.com>
parents: 6358
diff changeset
149 cur = g_strdup(msn_url_decode(pre->str));
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
150 g_string_free(pre, TRUE);
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
151
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
152 if (pre_ret != NULL)
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
153 *pre_ret = cur;
6359
dfde69e105ae [gaim-migrate @ 6863]
Christian Hammond <chipx86@chipx86.com>
parents: 6358
diff changeset
154 else
dfde69e105ae [gaim-migrate @ 6863]
Christian Hammond <chipx86@chipx86.com>
parents: 6358
diff changeset
155 g_free(cur);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156
6359
dfde69e105ae [gaim-migrate @ 6863]
Christian Hammond <chipx86@chipx86.com>
parents: 6358
diff changeset
157 cur = g_strdup(msn_url_decode(post->str));
6358
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
158 g_string_free(post, TRUE);
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
159
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
160 if (post_ret != NULL)
8ba58b296cc1 [gaim-migrate @ 6862]
Christian Hammond <chipx86@chipx86.com>
parents: 6093
diff changeset
161 *post_ret = cur;
6359
dfde69e105ae [gaim-migrate @ 6863]
Christian Hammond <chipx86@chipx86.com>
parents: 6358
diff changeset
162 else
dfde69e105ae [gaim-migrate @ 6863]
Christian Hammond <chipx86@chipx86.com>
parents: 6358
diff changeset
163 g_free(cur);
5309
e2e53316a21d [gaim-migrate @ 5681]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164 }