Fri, 20 Oct 2023 01:09:45 -0500
Implement ProtocolFileTransfer
Testing Done:
Ran the unit tests under valgrind.
Bugs closed: PIDGIN-17833
Reviewed at https://reviews.imfreedom.org/r/2643/
|
41719
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #include "purpleprotocolwhiteboard.h" |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | /****************************************************************************** |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | * GObject Implementation |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | *****************************************************************************/ |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | G_DEFINE_INTERFACE(PurpleProtocolWhiteboard, purple_protocol_whiteboard, |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | PURPLE_TYPE_PROTOCOL) |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | static void |
|
41960
c8a4853205e3
Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41719
diff
changeset
|
32 | purple_protocol_whiteboard_default_init(G_GNUC_UNUSED PurpleProtocolWhiteboardInterface *iface) |
|
41719
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | { |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | } |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | /****************************************************************************** |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | * Public API |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | *****************************************************************************/ |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | PurpleWhiteboard * |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | purple_protocol_whiteboard_create(PurpleProtocolWhiteboard *whiteboard, |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | PurpleAccount *account, const gchar *who, |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | gint state) |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | { |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | PurpleProtocolWhiteboardInterface *iface = NULL; |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | g_return_val_if_fail(PURPLE_IS_PROTOCOL_WHITEBOARD(whiteboard), NULL); |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | iface = PURPLE_PROTOCOL_WHITEBOARD_GET_IFACE(whiteboard); |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | if(iface != NULL && iface->create != NULL) { |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | return iface->create(whiteboard, account, who, state); |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | } |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | return NULL; |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | } |