Thu, 13 Feb 2020 20:57:31 -0600
Move the libidn check to jabber/meson.build as it needs specific functions of the library
| 7014 | 1 | /** |
| 2 | * @file buddy.h Buddy handlers | |
| 3 | * | |
| 15884 | 4 | * purple |
| 7014 | 5 | * |
|
28322
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
28071
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:
28071
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:
28071
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:
18235
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_BUDDY_H |
|
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
26 | #define PURPLE_JABBER_BUDDY_H |
| 7014 | 27 | |
|
28071
a0706162fefd
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <darkrain42@pidgin.im>
parents:
27287
diff
changeset
|
28 | typedef struct _JabberBuddy JabberBuddy; |
|
a0706162fefd
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <darkrain42@pidgin.im>
parents:
27287
diff
changeset
|
29 | |
|
39480
5e089a52b01b
Move the ProtocolActionInterface to action.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37134
diff
changeset
|
30 | #include "action.h" |
|
5e089a52b01b
Move the ProtocolActionInterface to action.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37134
diff
changeset
|
31 | |
|
17800
39a0f9ed0e26
Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
Andreas Monitzer <am@adiumx.com>
parents:
17795
diff
changeset
|
32 | #include "jabber.h" |
|
17816
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
33 | #include "caps.h" |
|
29384
b7b6be8f77fd
jabber: Move those functions to jutil.[ch]
Paul Aurich <darkrain42@pidgin.im>
parents:
29383
diff
changeset
|
34 | #include "jutil.h" |
|
17800
39a0f9ed0e26
Replaced a clean and simple API with a very weird hack due to vivid request on #pidgin by multiple devs. This avoids the change in PurplePluginProtocolInfo, but requires complicated change tracking in every prpl. The others prpl should add this change tracking, too (since otherwise the status gets changed even though nothing they care about changed), but that's not up to me.
Andreas Monitzer <am@adiumx.com>
parents:
17795
diff
changeset
|
35 | |
|
28071
a0706162fefd
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <darkrain42@pidgin.im>
parents:
27287
diff
changeset
|
36 | struct _JabberBuddy { |
|
29387
21ecdd98e791
jabber: Treat JabberBuddy->resources as a sorted list.
Paul Aurich <darkrain42@pidgin.im>
parents:
29384
diff
changeset
|
37 | /** |
|
21ecdd98e791
jabber: Treat JabberBuddy->resources as a sorted list.
Paul Aurich <darkrain42@pidgin.im>
parents:
29384
diff
changeset
|
38 | * A sorted list of resources in priority descending order. |
|
21ecdd98e791
jabber: Treat JabberBuddy->resources as a sorted list.
Paul Aurich <darkrain42@pidgin.im>
parents:
29384
diff
changeset
|
39 | * This means that the first resource in the list is the |
|
21ecdd98e791
jabber: Treat JabberBuddy->resources as a sorted list.
Paul Aurich <darkrain42@pidgin.im>
parents:
29384
diff
changeset
|
40 | * "most available" (see resource_compare_cb in buddy.c for |
|
21ecdd98e791
jabber: Treat JabberBuddy->resources as a sorted list.
Paul Aurich <darkrain42@pidgin.im>
parents:
29384
diff
changeset
|
41 | * details). Don't play with this yourself, let |
|
21ecdd98e791
jabber: Treat JabberBuddy->resources as a sorted list.
Paul Aurich <darkrain42@pidgin.im>
parents:
29384
diff
changeset
|
42 | * jabber_buddy_track_resource and jabber_buddy_remove_resource do it. |
|
21ecdd98e791
jabber: Treat JabberBuddy->resources as a sorted list.
Paul Aurich <darkrain42@pidgin.im>
parents:
29384
diff
changeset
|
43 | */ |
| 7014 | 44 | GList *resources; |
| 45 | char *error_msg; | |
| 46 | enum { | |
| 47 | JABBER_INVISIBLE_NONE = 0, | |
| 48 | JABBER_INVISIBLE_SERVER = 1 << 1, | |
| 49 | JABBER_INVIS_BUDDY = 1 << 2 | |
| 50 | } invisible; | |
| 51 | enum { | |
| 52 | JABBER_SUB_NONE = 0, | |
| 53 | JABBER_SUB_PENDING = 1 << 1, | |
| 54 | JABBER_SUB_TO = 1 << 2, | |
| 55 | JABBER_SUB_FROM = 1 << 3, | |
| 8194 | 56 | JABBER_SUB_BOTH = (JABBER_SUB_TO | JABBER_SUB_FROM), |
| 57 | JABBER_SUB_REMOVE = 1 << 4 | |
| 7014 | 58 | } subscription; |
|
28071
a0706162fefd
jabber: Store the "own JabberBuddy" in the JabberStream* struct.
Paul Aurich <darkrain42@pidgin.im>
parents:
27287
diff
changeset
|
59 | }; |
| 7014 | 60 | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39480
diff
changeset
|
61 | typedef struct { |
|
17816
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
62 | char *jid; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
63 | char *node; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
64 | char *name; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
65 | } JabberAdHocCommands; |
|
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
66 | |
|
39556
622bf98df0ac
Remove unnecessary struct tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39480
diff
changeset
|
67 | typedef struct { |
| 7116 | 68 | JabberBuddy *jb; |
| 69 | char *name; | |
| 70 | int priority; | |
| 9954 | 71 | JabberBuddyState state; |
| 7116 | 72 | char *status; |
|
24676
27ea4d447838
A first stab at supporting the upcoming new use-case in XMPP XEP-0012
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
73 | time_t idle; |
| 8312 | 74 | JabberCapabilities capabilities; |
| 8400 | 75 | char *thread_id; |
| 13708 | 76 | enum { |
| 77 | JABBER_CHAT_STATES_UNKNOWN, | |
| 78 | JABBER_CHAT_STATES_UNSUPPORTED, | |
| 79 | JABBER_CHAT_STATES_SUPPORTED | |
| 80 | } chat_states; | |
| 81 | struct { | |
| 82 | char *version; | |
| 83 | char *name; | |
| 84 | char *os; | |
| 85 | } client; | |
|
25822
23f62dd4aed5
Retrieve and display buddy's local time in Get Info dialog
Paul Aurich <darkrain42@pidgin.im>
parents:
24251
diff
changeset
|
86 | /* tz_off == PURPLE_NO_TZ_OFF when unset */ |
|
23f62dd4aed5
Retrieve and display buddy's local time in Get Info dialog
Paul Aurich <darkrain42@pidgin.im>
parents:
24251
diff
changeset
|
87 | long tz_off; |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
88 | struct { |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
89 | JabberCapsClientInfo *info; |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
90 | GList *exts; |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
91 | } caps; |
|
17816
1b7362b4a7a2
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <am@adiumx.com>
parents:
17807
diff
changeset
|
92 | GList *commands; |
|
27073
09bf5e6921e4
Only try to fetch adhoc commands from buddies once. Pushed updates (which we support now) are far superior.
Paul Aurich <darkrain42@pidgin.im>
parents:
26958
diff
changeset
|
93 | gboolean commands_fetched; |
| 7116 | 94 | } JabberBuddyResource; |
| 95 | ||
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
39819
diff
changeset
|
96 | void jabber_adhoc_commands_free(JabberAdHocCommands *cmd); |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
39819
diff
changeset
|
97 | |
| 7116 | 98 | void jabber_buddy_free(JabberBuddy *jb); |
| 7014 | 99 | JabberBuddy *jabber_buddy_find(JabberStream *js, const char *name, |
| 100 | gboolean create); | |
| 101 | JabberBuddyResource *jabber_buddy_find_resource(JabberBuddy *jb, | |
| 102 | const char *resource); | |
| 9954 | 103 | JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource, |
| 104 | int priority, JabberBuddyState state, const char *status); | |
| 7014 | 105 | void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource); |
| 15884 | 106 | void jabber_buddy_get_info(PurpleConnection *gc, const char *who); |
| 7014 | 107 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34699
diff
changeset
|
108 | GList *jabber_blist_node_menu(PurpleBlistNode *node); |
| 7014 | 109 | |
| 15884 | 110 | void jabber_set_info(PurpleConnection *gc, const char *info); |
|
36496
e7fe371c60a6
Refactored jabber to use the new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
111 | void jabber_setup_set_info(PurpleProtocolAction *action); |
|
35823
268a9d3b3fd7
imgstore: unref xmpp
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34864
diff
changeset
|
112 | void jabber_set_buddy_icon(PurpleConnection *gc, PurpleImage *img); |
| 7014 | 113 | |
|
17807
d98844d33c37
Exposed the user search function, so that directory searches can be performed directly when the jid is known.
Andreas Monitzer <am@adiumx.com>
parents:
17800
diff
changeset
|
114 | void jabber_user_search(JabberStream *js, const char *directory); |
|
36496
e7fe371c60a6
Refactored jabber to use the new API
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
115 | void jabber_user_search_begin(PurpleProtocolAction *); |
| 11675 | 116 | |
|
15363
f6b9d1e3d0cb
[gaim-migrate @ 18092]
Evan Schoenberg <evands@pidgin.im>
parents:
14254
diff
changeset
|
117 | void jabber_buddy_remove_all_pending_buddy_info_requests(JabberStream *js); |
|
f6b9d1e3d0cb
[gaim-migrate @ 18092]
Evan Schoenberg <evands@pidgin.im>
parents:
14254
diff
changeset
|
118 | |
|
18235
60a9bd99f035
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
16538
diff
changeset
|
119 | void jabber_vcard_fetch_mine(JabberStream *js); |
|
60a9bd99f035
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
16538
diff
changeset
|
120 | |
|
28879
27cc8217e86e
jabber: Determine if a buddy can receive a file transfer (when we have
Marcus Lundblad <malu@pidgin.im>
parents:
28322
diff
changeset
|
121 | gboolean jabber_resource_know_capabilities(const JabberBuddyResource *jbr); |
|
23626
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
19897
diff
changeset
|
122 | gboolean jabber_resource_has_capability(const JabberBuddyResource *jbr, |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
19897
diff
changeset
|
123 | const gchar *cap); |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
19897
diff
changeset
|
124 | gboolean jabber_buddy_has_capability(const JabberBuddy *jb, const gchar *cap); |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
19897
diff
changeset
|
125 | |
|
25577
ca0b40451bbc
Set a value "type" in the ui_info hash table
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
126 | const gchar * |
|
ca0b40451bbc
Set a value "type" in the ui_info hash table
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
127 | jabber_resource_get_identity_category_type(const JabberBuddyResource *jbr, |
|
ca0b40451bbc
Set a value "type" in the ui_info hash table
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
128 | const gchar *category); |
|
ca0b40451bbc
Set a value "type" in the ui_info hash table
Marcus Lundblad <malu@pidgin.im>
parents:
24251
diff
changeset
|
129 | |
|
39819
3554dac2991b
Standardize all protocol header guard macros.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39556
diff
changeset
|
130 | #endif /* PURPLE_JABBER_BUDDY_H */ |