Thu, 03 Sep 2020 20:16:32 -0500
Add support for message attachments
Add a PurpleAttachment for storing message attachments
A start to implementing the attachment api in PidginMessage
Add PidginAttachment that wraps PurpleAttachment.
Finish implementing the attachment management api in PidginMessage
Add PidginAttachment to the docs
Testing Done:
Compiled and ran. Messaged with bonjour.
Reviewed at https://reviews.imfreedom.org/r/76/
| 3630 | 1 | /* |
| 15884 | 2 | * purple |
|
5913
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
3 | * |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
4 | * File: win32dep.h |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
5 | * |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
6 | * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com> |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
7 | * |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
11 | * (at your option) any later version. |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
12 | * |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
16 | * GNU General Public License for more details. |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
17 | * |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
19 | * 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
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
5913
4d016c00bb36
[gaim-migrate @ 6345]
Herman Bloggs <herman@bluedigits.com>
parents:
5084
diff
changeset
|
21 | * |
| 3630 | 22 | */ |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39383
diff
changeset
|
23 | #ifndef PURPLE_WIN32_WIN32DEP_H |
|
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39383
diff
changeset
|
24 | #define PURPLE_WIN32_WIN32DEP_H |
|
35892
02bf3200b9cb
cross-win32: make use of WIN32_LEAN_AND_MEAN define
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35864
diff
changeset
|
25 | |
|
02bf3200b9cb
cross-win32: make use of WIN32_LEAN_AND_MEAN define
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35864
diff
changeset
|
26 | #include <config.h> |
|
02bf3200b9cb
cross-win32: make use of WIN32_LEAN_AND_MEAN define
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35864
diff
changeset
|
27 | |
|
22869
3fc7a5fc49eb
Include winsock2.h before windows.h is included to avoid winsock.h being
Daniel Atallah <datallah@pidgin.im>
parents:
22686
diff
changeset
|
28 | #include <winsock2.h> |
|
3fc7a5fc49eb
Include winsock2.h before windows.h is included to avoid winsock.h being
Daniel Atallah <datallah@pidgin.im>
parents:
22686
diff
changeset
|
29 | #include <windows.h> |
|
10673
3177232170c7
[gaim-migrate @ 12213]
Richard Laager <rlaager@pidgin.im>
parents:
10240
diff
changeset
|
30 | #include <shlobj.h> |
|
5084
21d2e7ec99ce
[gaim-migrate @ 5439]
Herman Bloggs <herman@bluedigits.com>
parents:
5008
diff
changeset
|
31 | #include <process.h> |
| 15884 | 32 | #include "wpurpleerror.h" |
|
3778
7d3d0c93cb2d
[gaim-migrate @ 3918]
Herman Bloggs <herman@bluedigits.com>
parents:
3712
diff
changeset
|
33 | #include "libc_interface.h" |
| 3630 | 34 | |
|
39383
0f9d49617abc
Use G_BEGIN_DECLS and G_END_DECLS instead of raw extern "C"
Mike Ruprecht <cmaiku@gmail.com>
parents:
39250
diff
changeset
|
35 | G_BEGIN_DECLS |
|
22686
d41016d7812d
Add extern "C" wrappers to win32 headers. There is also a change here that I thought I committed earlier that should provide better error messages for winsock errors.
Daniel Atallah <datallah@pidgin.im>
parents:
20597
diff
changeset
|
36 | |
|
24171
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
22869
diff
changeset
|
37 | /* the winapi headers don't yet have winhttp.h, so we use the struct from msdn directly */ |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
22869
diff
changeset
|
38 | typedef struct { |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
22869
diff
changeset
|
39 | BOOL fAutoDetect; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
22869
diff
changeset
|
40 | LPWSTR lpszAutoConfigUrl; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
22869
diff
changeset
|
41 | LPWSTR lpszProxy; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
22869
diff
changeset
|
42 | LPWSTR lpszProxyBypass; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
22869
diff
changeset
|
43 | } WINHTTP_CURRENT_USER_IE_PROXY_CONFIG; |
|
d976cc3db118
Add support for reading SOCKS proxy information from the Windows proxy settings.
Daniel Atallah <datallah@pidgin.im>
parents:
22869
diff
changeset
|
44 | |
|
15459
2b5e94b4b17a
Fix win32 build for status icon changes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
45 | /* rpcndr.h defines small as char, causing problems, so we need to undefine it */ |
|
2b5e94b4b17a
Fix win32 build for status icon changes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
46 | #undef small |
|
2b5e94b4b17a
Fix win32 build for status icon changes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
47 | |
|
3712
d926a65b5f89
[gaim-migrate @ 3845]
Herman Bloggs <herman@bluedigits.com>
parents:
3630
diff
changeset
|
48 | /* |
|
d926a65b5f89
[gaim-migrate @ 3845]
Herman Bloggs <herman@bluedigits.com>
parents:
3630
diff
changeset
|
49 | * PROTOS |
|
d926a65b5f89
[gaim-migrate @ 3845]
Herman Bloggs <herman@bluedigits.com>
parents:
3630
diff
changeset
|
50 | */ |
|
d926a65b5f89
[gaim-migrate @ 3845]
Herman Bloggs <herman@bluedigits.com>
parents:
3630
diff
changeset
|
51 | |
|
3950
0cab330f1cd6
[gaim-migrate @ 4129]
Herman Bloggs <herman@bluedigits.com>
parents:
3907
diff
changeset
|
52 | /** |
|
0cab330f1cd6
[gaim-migrate @ 4129]
Herman Bloggs <herman@bluedigits.com>
parents:
3907
diff
changeset
|
53 | ** win32dep.c |
|
0cab330f1cd6
[gaim-migrate @ 4129]
Herman Bloggs <herman@bluedigits.com>
parents:
3907
diff
changeset
|
54 | **/ |
|
5084
21d2e7ec99ce
[gaim-migrate @ 5439]
Herman Bloggs <herman@bluedigits.com>
parents:
5008
diff
changeset
|
55 | /* Windows helper functions */ |
| 15884 | 56 | FARPROC wpurple_find_and_loadproc(const char *dllname, const char *procedure); |
|
35114
b833eaa6c76f
Log reader: fix some Trilian-related warnings in debug output. Refs #15279
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33291
diff
changeset
|
57 | gboolean wpurple_reg_val_exists(HKEY rootkey, const char *subkey, const char *valname); |
|
24231
6907b62f25fe
Warnings cleanup from Lee Roach. Fixes #6242.
Daniel Atallah <datallah@pidgin.im>
parents:
24171
diff
changeset
|
58 | gboolean wpurple_read_reg_dword(HKEY rootkey, const char *subkey, const char *valname, LPDWORD result); |
| 15884 | 59 | char *wpurple_read_reg_string(HKEY rootkey, const char *subkey, const char *valname); /* needs to be g_free'd */ |
| 60 | gboolean wpurple_write_reg_string(HKEY rootkey, const char *subkey, const char *valname, const char *value); | |
| 61 | char *wpurple_escape_dirsep(const char *filename); /* needs to be g_free'd */ | |
|
12497
a17568773be3
[gaim-migrate @ 14809]
Richard Laager <rlaager@pidgin.im>
parents:
11709
diff
changeset
|
62 | |
|
33291
b70ab10887a7
New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
24231
diff
changeset
|
63 | /* Simulate unix pipes by creating a pair of connected sockets */ |
|
b70ab10887a7
New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
24231
diff
changeset
|
64 | int wpurple_input_pipe(int pipefd[2]); |
|
b70ab10887a7
New custom resolver, that uses libpurple for DNS queries. Get rid of old win32 resolver. Refs#343. Fixes #6263
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
24231
diff
changeset
|
65 | |
| 15884 | 66 | /* Determine Purple paths */ |
|
22686
d41016d7812d
Add extern "C" wrappers to win32 headers. There is also a change here that I thought I committed earlier that should provide better error messages for winsock errors.
Daniel Atallah <datallah@pidgin.im>
parents:
20597
diff
changeset
|
67 | gchar *wpurple_get_special_folder(int folder_type); /* needs to be g_free'd */ |
|
35901
5bcb306a4edf
cross-win32: FHS support for win32
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35892
diff
changeset
|
68 | const char *wpurple_bin_dir(void); |
|
5bcb306a4edf
cross-win32: FHS support for win32
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35892
diff
changeset
|
69 | const char *wpurple_data_dir(void); |
|
5bcb306a4edf
cross-win32: FHS support for win32
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35892
diff
changeset
|
70 | const char *wpurple_lib_dir(const char *subdir); |
| 15884 | 71 | const char *wpurple_locale_dir(void); |
|
35864
a9dfa29e3382
cross-win32: correct PURPLE_DATADIR location, rename misleading wpurple_data_dir()
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35850
diff
changeset
|
72 | const char *wpurple_home_dir(void); |
|
35850
1abeda205d6c
cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35114
diff
changeset
|
73 | const char *wpurple_sysconf_dir(void); |
|
12497
a17568773be3
[gaim-migrate @ 14809]
Richard Laager <rlaager@pidgin.im>
parents:
11709
diff
changeset
|
74 | |
|
3950
0cab330f1cd6
[gaim-migrate @ 4129]
Herman Bloggs <herman@bluedigits.com>
parents:
3907
diff
changeset
|
75 | /* init / cleanup */ |
| 15884 | 76 | void wpurple_init(void); |
| 77 | void wpurple_cleanup(void); | |
|
12497
a17568773be3
[gaim-migrate @ 14809]
Richard Laager <rlaager@pidgin.im>
parents:
11709
diff
changeset
|
78 | |
|
39383
0f9d49617abc
Use G_BEGIN_DECLS and G_END_DECLS instead of raw extern "C"
Mike Ruprecht <cmaiku@gmail.com>
parents:
39250
diff
changeset
|
79 | G_END_DECLS |
|
22686
d41016d7812d
Add extern "C" wrappers to win32 headers. There is also a change here that I thought I committed earlier that should provide better error messages for winsock errors.
Daniel Atallah <datallah@pidgin.im>
parents:
20597
diff
changeset
|
80 | |
|
39659
e4dfb99b0cef
Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39383
diff
changeset
|
81 | #endif /* PURPLE_WIN32_WIN32DEP_H */ |