Mon, 13 Jul 2009 05:01:42 +0000
On MSN, pop up an "invite message" request similar to oscar, and send that
in the add request. We really should try and move this into the add buddy
dialog instead of an extra prompt.
Fixes #8503.
| 5370 | 1 | /** |
| 2 | * @file page.c Paging functions | |
| 3 | * | |
| 15884 | 4 | * purple |
| 5370 | 5 | * |
| 15884 | 6 | * Purple is the legal property of its developers, whose names are too numerous |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9092
diff
changeset
|
8 | * source distribution. |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5370
diff
changeset
|
9 | * |
| 5370 | 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5370 | 23 | */ |
| 24 | #include "msn.h" | |
| 25 | #include "page.h" | |
| 26 | ||
| 27 | MsnPage * | |
| 28 | msn_page_new(void) | |
| 29 | { | |
| 30 | MsnPage *page; | |
| 31 | ||
| 32 | page = g_new0(MsnPage, 1); | |
| 33 | ||
| 34 | return page; | |
| 35 | } | |
| 36 | ||
| 37 | void | |
| 38 | msn_page_destroy(MsnPage *page) | |
| 39 | { | |
| 40 | g_return_if_fail(page != NULL); | |
| 41 | ||
|
22981
b83a23981419
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents:
21067
diff
changeset
|
42 | g_free(page->body); |
|
b83a23981419
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents:
21067
diff
changeset
|
43 | g_free(page->from_location); |
|
b83a23981419
Fix a number of leaks. As far as I can tell, MSNP14 now logs in without
Daniel Atallah <datallah@pidgin.im>
parents:
21067
diff
changeset
|
44 | g_free(page->from_phone); |
| 5370 | 45 | |
| 46 | g_free(page); | |
| 47 | } | |
| 48 | ||
| 49 | char * | |
|
8646
74d0e7406e3b
[gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8475
diff
changeset
|
50 | msn_page_gen_payload(const MsnPage *page, size_t *ret_size) |
| 5370 | 51 | { |
| 52 | char *str; | |
|
24073
9c569eb69980
Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24072
diff
changeset
|
53 | char *body; |
| 5370 | 54 | |
| 55 | g_return_val_if_fail(page != NULL, NULL); | |
| 56 | ||
|
24073
9c569eb69980
Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24072
diff
changeset
|
57 | body = g_markup_escape_text(msn_page_get_body(page), -1); |
|
9c569eb69980
Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24072
diff
changeset
|
58 | str = g_strdup_printf( |
|
23885
92d17559f603
Properly escape text when sending MSN pages.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22981
diff
changeset
|
59 | "<TEXT xml:space=\"preserve\" enc=\"utf-8\">%s</TEXT>", |
|
24073
9c569eb69980
Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24072
diff
changeset
|
60 | body); |
|
9c569eb69980
Remove calls to g_markup_escape_text. Not only does this help with old
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
24072
diff
changeset
|
61 | g_free(body); |
| 5370 | 62 | |
|
8646
74d0e7406e3b
[gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8475
diff
changeset
|
63 | if (ret_size != NULL) |
|
9092
34b9e78827f6
[gaim-migrate @ 9869]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
64 | *ret_size = strlen(str); |
| 5370 | 65 | |
| 66 | return str; | |
| 67 | } | |
| 68 | ||
| 69 | void | |
| 70 | msn_page_set_body(MsnPage *page, const char *body) | |
| 71 | { | |
| 72 | g_return_if_fail(page != NULL); | |
| 73 | g_return_if_fail(body != NULL); | |
| 74 | ||
|
21067
97a745428ab0
Cleanup some unnecessary NULL checks in g_strdup()/g_free().
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
75 | g_free(page->body); |
| 5370 | 76 | page->body = g_strdup(body); |
| 77 | } | |
| 78 | ||
| 79 | const char * | |
| 80 | msn_page_get_body(const MsnPage *page) | |
| 81 | { | |
| 82 | g_return_val_if_fail(page != NULL, NULL); | |
| 83 | ||
| 84 | return page->body; | |
| 85 | } |