2 * @file presence.h Presence
6 * Purple is the legal property of its developers, whose names are too numerous
7 * to list here. Please refer to the COPYRIGHT file distributed with this
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.
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.
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
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 #ifndef PURPLE_JABBER_PRESENCE_H
26 #define PURPLE_JABBER_PRESENCE_H
29 JABBER_PRESENCE_ERROR
= -2,
30 JABBER_PRESENCE_PROBE
= -1,
31 JABBER_PRESENCE_AVAILABLE
,
32 JABBER_PRESENCE_UNAVAILABLE
,
33 JABBER_PRESENCE_SUBSCRIBE
,
34 JABBER_PRESENCE_SUBSCRIBED
,
35 JABBER_PRESENCE_UNSUBSCRIBE
,
36 JABBER_PRESENCE_UNSUBSCRIBED
39 typedef struct _JabberPresenceChatInfo JabberPresenceChatInfo
;
40 typedef struct _JabberPresence JabberPresence
;
48 struct _JabberPresenceChatInfo
{
53 struct _JabberPresence
{
54 JabberPresenceType type
;
62 JabberPresenceChatInfo chat_info
;
63 PurpleXmlNode
*caps
; /* TODO: Temporary, see presence.c:parse_caps */
65 JabberBuddyState state
;
69 char *vcard_avatar_hash
;
75 gboolean adjust_idle_for_delay
;
78 typedef void (JabberPresenceHandler
)(JabberStream
*js
, JabberPresence
*presence
,
79 PurpleXmlNode
*child
);
80 void jabber_presence_register_handler(const char *node
, const char *xmlns
,
81 JabberPresenceHandler
*handler
);
83 void jabber_presence_init(void);
84 void jabber_presence_uninit(void);
86 void jabber_set_status(PurpleAccount
*account
, PurpleStatus
*status
);
89 * Send a full presence stanza.
91 * @param js A JabberStream object.
92 * @param force Force sending the presence stanza, irrespective of whether
93 * the contents seem to have changed.
95 void jabber_presence_send(JabberStream
*js
, gboolean force
);
97 PurpleXmlNode
*jabber_presence_create_js(JabberStream
*js
, JabberBuddyState state
, const char *msg
, int priority
);
98 void jabber_presence_parse(JabberStream
*js
, PurpleXmlNode
*packet
);
99 void jabber_presence_subscription_set(JabberStream
*js
, const char *who
,
101 void jabber_presence_fake_to_self(JabberStream
*js
, PurpleStatus
*status
);
102 void purple_status_to_jabber(PurpleStatus
*status
, JabberBuddyState
*state
, char **msg
, int *priority
);
104 #endif /* PURPLE_JABBER_PRESENCE_H */