Thu, 13 Jan 2022 22:33:15 -0600
Port JabberPresence from time_t to GDateTime
Testing Done:
Connected and XMPP account, sent some messages, and verified that a carbon message showed up fine.
Reviewed at https://reviews.imfreedom.org/r/1213/
| 7014 | 1 | /** |
| 2 | * @file chat.h Chat stuff | |
| 3 | * | |
| 15884 | 4 | * purple |
| 7014 | 5 | * |
|
28322
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
27110
diff
changeset
|
6 | * Purple is the legal property of its developers, whose names are too numerous |
|
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
27110
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
27110
diff
changeset
|
8 | * source distribution. |
| 7014 | 9 | * |
| 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 |
| 7014 | 23 | */ |
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
24 | |
|
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
25 | #ifndef PURPLE_JABBER_CHAT_H |
|
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
26 | #define PURPLE_JABBER_CHAT_H |
| 7014 | 27 | |
|
40358
e6fe6fc1f516
move all protocols, purple plugins, and purple tests to use purple.h instead of including files individually
Gary Kramlich <grim@reaperworld.com>
parents:
39819
diff
changeset
|
28 | #include <purple.h> |
| 7014 | 29 | |
| 30 | #include "jabber.h" | |
| 31 | ||
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36637
diff
changeset
|
32 | typedef struct { |
| 9152 | 33 | char *handle; |
| 34 | char *jid; | |
| 35 | } JabberChatMember; | |
| 36 | ||
| 7014 | 37 | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
36637
diff
changeset
|
38 | typedef struct { |
| 7014 | 39 | JabberStream *js; |
| 40 | char *room; | |
| 41 | char *server; | |
| 8400 | 42 | char *handle; |
|
23270
2b7db16e721a
As discussed on the devel list, purple_serv_got_join_chat_failed() and the
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
43 | GHashTable *components; |
| 7014 | 44 | int id; |
|
34634
90fa70aa7e28
Refactored the jabber protocol to use GObject-based PurpleConversation
Ankit Vani <a@nevitus.org>
parents:
31442
diff
changeset
|
45 | PurpleChatConversation *conv; |
| 7014 | 46 | gboolean muc; |
| 7345 | 47 | gboolean xhtml; |
| 15884 | 48 | PurpleRequestType config_dialog_type; |
| 8396 | 49 | void *config_dialog_handle; |
| 9152 | 50 | GHashTable *members; |
|
23403
a8704d47889f
Fix the chat-room rejoining bug where the list appears empty.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23270
diff
changeset
|
51 | gboolean left; |
|
41244
5535c6fdd135
Port JabberPresence from time_t to GDateTime
Gary Kramlich <grim@reaperworld.com>
parents:
41028
diff
changeset
|
52 | GDateTime *joined; |
| 7014 | 53 | } JabberChat; |
| 54 | ||
|
40697
81f81f5d2f39
Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
55 | GList *jabber_chat_info(PurpleProtocolChat *protocol_chat, PurpleConnection *connection); |
| 15884 | 56 | GHashTable *jabber_chat_info_defaults(PurpleConnection *gc, 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
|
57 | char *jabber_get_chat_name(PurpleProtocolChat *protocol_chat, GHashTable *data); |
|
28668
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
58 | |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
59 | /** |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
60 | * in-protocol function for joining a chat room. Doesn't require sticking goop |
|
28668
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
61 | * into a hash table. |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
62 | * |
|
28687
9de3f49f3b30
jabber: Remove useless jabber_normalize calls now that the data in the hash table
Paul Aurich <darkrain42@pidgin.im>
parents:
28669
diff
changeset
|
63 | * @param room The room to join. This MUST be normalized already. |
|
9de3f49f3b30
jabber: Remove useless jabber_normalize calls now that the data in the hash table
Paul Aurich <darkrain42@pidgin.im>
parents:
28669
diff
changeset
|
64 | * @param server The server the room is on. This MUST be normalized already. |
|
28668
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
65 | * @param password The password (if required) to join the room. May be NULL. |
|
28669
f67839ca0064
jabber: Use the newly refactored code to simplify "Initiate Chat".
Paul Aurich <darkrain42@pidgin.im>
parents:
28668
diff
changeset
|
66 | * @param data The chat hash table. May be NULL (it will be generated |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
34670
diff
changeset
|
67 | * for current core<>protocol API interface.) |
|
28668
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
68 | */ |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
69 | JabberChat *jabber_join_chat(JabberStream *js, const char *room, |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
70 | const char *server, const char *handle, |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
71 | const char *password, GHashTable *data); |
|
2f7479b4d0c0
jabber: Refactor the chat-joining code
Paul Aurich <darkrain42@pidgin.im>
parents:
28322
diff
changeset
|
72 | |
| 15884 | 73 | void jabber_chat_join(PurpleConnection *gc, GHashTable *data); |
| 7014 | 74 | JabberChat *jabber_chat_find(JabberStream *js, const char *room, |
| 75 | const char *server); | |
| 76 | JabberChat *jabber_chat_find_by_id(JabberStream *js, int id); | |
|
34634
90fa70aa7e28
Refactored the jabber protocol to use GObject-based PurpleConversation
Ankit Vani <a@nevitus.org>
parents:
31442
diff
changeset
|
77 | JabberChat *jabber_chat_find_by_conv(PurpleChatConversation *conv); |
| 7014 | 78 | void jabber_chat_destroy(JabberChat *chat); |
| 8396 | 79 | void jabber_chat_free(JabberChat *chat); |
|
34634
90fa70aa7e28
Refactored the jabber protocol to use GObject-based PurpleConversation
Ankit Vani <a@nevitus.org>
parents:
31442
diff
changeset
|
80 | gboolean jabber_chat_find_buddy(PurpleChatConversation *conv, const char *name); |
| 15884 | 81 | void jabber_chat_invite(PurpleConnection *gc, int id, const char *message, |
| 7014 | 82 | const char *name); |
|
40697
81f81f5d2f39
Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
83 | void jabber_chat_leave(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id); |
|
81f81f5d2f39
Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
84 | char *jabber_chat_user_real_name(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id, const char *who); |
| 7923 | 85 | void jabber_chat_request_room_configure(JabberChat *chat); |
| 7895 | 86 | void jabber_chat_create_instant_room(JabberChat *chat); |
| 7971 | 87 | void jabber_chat_register(JabberChat *chat); |
| 88 | void jabber_chat_change_topic(JabberChat *chat, const char *topic); | |
|
40697
81f81f5d2f39
Split PurpleProtocolChat to its own file and clean up the API.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
89 | void jabber_chat_set_topic(PurpleProtocolChat *protocol_chat, PurpleConnection *gc, int id, const char *topic); |
|
28734
886d6c5e8f9a
jabber: Reject invalid chat nicks in /nick command. Fixes #10532.
Paul Aurich <darkrain42@pidgin.im>
parents:
28687
diff
changeset
|
90 | gboolean jabber_chat_change_nick(JabberChat *chat, const char *nick); |
| 7974 | 91 | void jabber_chat_part(JabberChat *chat, const char *msg); |
| 9152 | 92 | void jabber_chat_track_handle(JabberChat *chat, const char *handle, |
| 93 | const char *jid, const char *affiliation, const char *role); | |
| 94 | void jabber_chat_remove_handle(JabberChat *chat, const char *handle); | |
| 95 | gboolean jabber_chat_ban_user(JabberChat *chat, const char *who, | |
| 96 | const char *why); | |
| 11393 | 97 | gboolean jabber_chat_affiliate_user(JabberChat *chat, const char *who, |
| 98 | const char *affiliation); | |
|
27027
f3129efa65ea
Add ability to list roles/affiliations in a chat via slash-commands and
Paul Aurich <darkrain42@pidgin.im>
parents:
26703
diff
changeset
|
99 | gboolean jabber_chat_affiliation_list(JabberChat *chat, const char *affiliation); |
|
13238
b98439d90903
[gaim-migrate @ 15603]
Andrej Krivulčík <thefox692@users.sourceforge.net>
parents:
11393
diff
changeset
|
100 | gboolean jabber_chat_role_user(JabberChat *chat, const char *who, |
|
29400
8d8ad40c9c7d
jabber: Kick by in-room nick, not JID. Reduces code, but is still in-spec (and seems to be the preferred method)
Paul Aurich <darkrain42@pidgin.im>
parents:
28734
diff
changeset
|
101 | const char *role, const char *why); |
|
27027
f3129efa65ea
Add ability to list roles/affiliations in a chat via slash-commands and
Paul Aurich <darkrain42@pidgin.im>
parents:
26703
diff
changeset
|
102 | gboolean jabber_chat_role_list(JabberChat *chat, const char *role); |
| 7398 | 103 | |
|
41028
943b2cb45314
Separate PurpleProtocolRoomlist into its own file and modernize it.
Gary Kramlich <grim@reaperworld.com>
parents:
40697
diff
changeset
|
104 | PurpleRoomlist *jabber_roomlist_get_list(PurpleProtocolRoomlist *protocol_roomlist, PurpleConnection *gc); |
|
943b2cb45314
Separate PurpleProtocolRoomlist into its own file and modernize it.
Gary Kramlich <grim@reaperworld.com>
parents:
40697
diff
changeset
|
105 | void jabber_roomlist_cancel(PurpleProtocolRoomlist *protocol_roomlist, PurpleRoomlist *list); |
|
943b2cb45314
Separate PurpleProtocolRoomlist into its own file and modernize it.
Gary Kramlich <grim@reaperworld.com>
parents:
40697
diff
changeset
|
106 | char *jabber_roomlist_room_serialize(PurpleProtocolRoomlist *protocol_roomlist, PurpleRoomlistRoom *room); |
| 8113 | 107 | |
| 10941 | 108 | void jabber_chat_disco_traffic(JabberChat *chat); |
| 109 | ||
|
27110
05ca719b901b
Support custom smileys in MUCs (when all participants support BoB and a maximum
Marcus Lundblad <malu@pidgin.im>
parents:
27027
diff
changeset
|
110 | gboolean jabber_chat_all_participants_have_capability(const JabberChat *chat, |
|
05ca719b901b
Support custom smileys in MUCs (when all participants support BoB and a maximum
Marcus Lundblad <malu@pidgin.im>
parents:
27027
diff
changeset
|
111 | const gchar *cap); |
|
05ca719b901b
Support custom smileys in MUCs (when all participants support BoB and a maximum
Marcus Lundblad <malu@pidgin.im>
parents:
27027
diff
changeset
|
112 | guint jabber_chat_get_num_participants(const JabberChat *chat); |
| 7014 | 113 | |
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
114 | #endif /* PURPLE_JABBER_CHAT_H */ |