Fri, 09 Aug 2013 13:03:26 +0200
HTTP: successful is spelled with one l
|
33348
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
1 | /* purple |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
2 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
3 | * Purple is the legal property of its developers, whose names are too numerous |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
5 | * source distribution. |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
6 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
7 | * Rewritten from scratch during Google Summer of Code 2012 |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
8 | * by Tomek Wasilczyk (http://www.wasilczyk.pl). |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
9 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
10 | * Previously implemented by: |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
11 | * - Arkadiusz Miskiewicz <misiek@pld.org.pl> - first implementation (2001); |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
12 | * - Bartosz Oler <bartosz@bzimage.us> - reimplemented during GSoC 2005; |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
13 | * - Krzysztof Klinikowski <grommasher@gmail.com> - some parts (2009-2011). |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
14 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
15 | * This program is free software; you can redistribute it and/or modify |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
16 | * it under the terms of the GNU General Public License as published by |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
17 | * the Free Software Foundation; either version 2 of the License, or |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
18 | * (at your option) any later version. |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
19 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
20 | * This program is distributed in the hope that it will be useful, |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
23 | * GNU General Public License for more details. |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
24 | * |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
25 | * You should have received a copy of the GNU General Public License |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
26 | * along with this program; if not, write to the Free Software |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
27 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
28 | */ |
|
2394cd23ce8f
Gadu-Gadu: add GSoC copyright note
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33313
diff
changeset
|
29 | |
|
33298
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
30 | #ifndef _GGP_IMAGE_H |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
31 | #define _GGP_IMAGE_H |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
32 | |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
33 | #include <internal.h> |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
34 | #include <libgadu.h> |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
35 | |
|
33301
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
36 | #define GGP_IMAGE_SIZE_MAX 255000 |
|
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
37 | |
|
33298
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
38 | typedef struct |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
39 | { |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
40 | GList *pending_messages; |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
41 | GHashTable *pending_images; |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
42 | } ggp_image_connection_data; |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
43 | |
|
33301
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
44 | typedef enum |
|
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
45 | { |
|
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
46 | GGP_IMAGE_PREPARE_OK = 0, |
|
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
47 | GGP_IMAGE_PREPARE_FAILURE, |
|
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
48 | GGP_IMAGE_PREPARE_TOO_BIG |
|
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
49 | } ggp_image_prepare_result; |
|
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
50 | |
|
33298
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
51 | void ggp_image_setup(PurpleConnection *gc); |
|
33313
5a0c6582d5b1
Gadu-Gadu: refactoring of buddy avatars handling. Fixes #13739, #14305
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33302
diff
changeset
|
52 | void ggp_image_cleanup(PurpleConnection *gc); |
|
33298
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
53 | |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
54 | const char * ggp_image_pending_placeholder(uint32_t id); |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
55 | |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
56 | void ggp_image_got_im(PurpleConnection *gc, uin_t from, gchar *msg, |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
57 | time_t mtime); |
|
33301
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
58 | ggp_image_prepare_result ggp_image_prepare(PurpleConnection *gc, const int id, |
|
33302
e094fcb98670
Gadu-Gadu: acknowledgment for sent images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33301
diff
changeset
|
59 | const char *conv_name, struct gg_msg_richtext_image *image_info); |
|
33298
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
60 | |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
61 | void ggp_image_recv(PurpleConnection *gc, |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
62 | const struct gg_event_image_reply *image_reply); |
|
33301
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
63 | void ggp_image_send(PurpleConnection *gc, |
|
3f18ba8aed0f
Gadu-Gadu sending images refactoring; notify about too large images
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33298
diff
changeset
|
64 | const struct gg_event_image_request *image_request); |
|
33298
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
65 | |
|
519acf37d16e
Gadu-Gadu: fix receiving of inline images after 3.x changes; code refactoring here as well
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff
changeset
|
66 | #endif /* _GGP_IMAGE_H */ |