libpurple/protocols/gg/chat.h

Mon, 08 Mar 2021 23:22:02 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 08 Mar 2021 23:22:02 -0600
changeset 40813
71305a7d7423
parent 40697
81f81f5d2f39
child 41028
943b2cb45314
permissions
-rw-r--r--

Modernize PurpleProtocol

* Migrate PurpleProtocol to the `G_DECLARE_DERIVABLE_TYPE` and `G_DEFINE_TYPE` macros.
* Rename `purple_protocol_class_*` to `purple_protocol_*`.
* Move the class properties to instance properties and add accessors as necessary.

Testing Done:
Ran locally and connected with bonjour, facebook, irc, and xmpp. Verified that the other prpls are loading and visible in the account manager.

Bugs closed: PIDGIN-17492

Reviewed at https://reviews.imfreedom.org/r/552/

35358
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
1 /* purple
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
2 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
5 * source distribution.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
6 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
7 * Component written by Tomek Wasilczyk (http://www.wasilczyk.pl).
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
8 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
9 * This file is dual-licensed under the GPL2+ and the X11 (MIT) licences.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
10 * As a recipient of this file you may choose, which license to receive the
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
11 * code under. As a contributor, you have to ensure the new code is
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
12 * compatible with both.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
13 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
14 * This program is free software; you can redistribute it and/or modify
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
15 * it under the terms of the GNU General Public License as published by
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
16 * the Free Software Foundation; either version 2 of the License, or
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
17 * (at your option) any later version.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
18 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
19 * This program is distributed in the hope that it will be useful,
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
22 * GNU General Public License for more details.
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
23 *
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
24 * You should have received a copy of the GNU General Public License
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
25 * along with this program; if not, write to the Free Software
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
7beae478c905 Style: fix gg (partially)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34437
diff changeset
27 */
39819
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 36124
diff changeset
28
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 36124
diff changeset
29 #ifndef PURPLE_GG_CHAT_H
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 36124
diff changeset
30 #define PURPLE_GG_CHAT_H
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
31
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 39819
diff changeset
32 #include <purple.h>
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
33 #include <libgadu.h>
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
34
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
35 typedef struct _ggp_chat_session_data ggp_chat_session_data;
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
36
34437
ca6d1b4d24b5 Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34352
diff changeset
37 #include "gg.h"
ca6d1b4d24b5 Gadu-Gadu: add an option to disable new libgadu API
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34352
diff changeset
38
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
39 void ggp_chat_setup(PurpleConnection *gc);
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
40 void ggp_chat_cleanup(PurpleConnection *gc);
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
41
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
42 void ggp_chat_got_event(PurpleConnection *gc, const struct gg_event *ev);
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
43
40697
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
44 GList * ggp_chat_info(PurpleProtocolChat *protocol_chat, PurpleConnection *gc);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
45 GHashTable * ggp_chat_info_defaults(PurpleProtocolChat *protocol_chat, PurpleConnection *gc,
34352
16ee13f507a0 Gadu-Gadu: room list
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34350
diff changeset
46 const char *chat_name);
40697
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
47 char * ggp_chat_get_name(PurpleProtocolChat *protocol_chat, GHashTable *components);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
48 void ggp_chat_join(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, GHashTable *components);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
49 void ggp_chat_leave(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int local_id);
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
50 void ggp_chat_invite(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int local_id, const char *message,
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
51 const char *who);
40697
81f81f5d2f39 Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
52 int ggp_chat_send(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int local_id, PurpleMessage *msg);
34350
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
53
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
54 void ggp_chat_got_message(PurpleConnection *gc, uint64_t chat_id,
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
55 const char *message, time_t time, uin_t who);
89441dbabc83 Gadu-Gadu: initial GG11 conferences support
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
diff changeset
56
34352
16ee13f507a0 Gadu-Gadu: room list
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34350
diff changeset
57 PurpleRoomlist * ggp_chat_roomlist_get_list(PurpleConnection *gc);
16ee13f507a0 Gadu-Gadu: room list
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34350
diff changeset
58
39819
3554dac2991b Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 36124
diff changeset
59 #endif /* PURPLE_GG_CHAT_H */

mercurial