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
24 #ifndef PURPLE_JABBER_PRESENCE_H_
25 #define PURPLE_JABBER_PRESENCE_H_
28 JABBER_PRESENCE_ERROR
= -2,
29 JABBER_PRESENCE_PROBE
= -1,
30 JABBER_PRESENCE_AVAILABLE
,
31 JABBER_PRESENCE_UNAVAILABLE
,
32 JABBER_PRESENCE_SUBSCRIBE
,
33 JABBER_PRESENCE_SUBSCRIBED
,
34 JABBER_PRESENCE_UNSUBSCRIBE
,
35 JABBER_PRESENCE_UNSUBSCRIBED
38 typedef struct _JabberPresenceChatInfo JabberPresenceChatInfo
;
39 typedef struct _JabberPresence JabberPresence
;
47 struct _JabberPresenceChatInfo
{
52 struct _JabberPresence
{
53 JabberPresenceType type
;
61 JabberPresenceChatInfo chat_info
;
62 PurpleXmlNode
*caps
; /* TODO: Temporary, see presence.c:parse_caps */
64 JabberBuddyState state
;
68 char *vcard_avatar_hash
;
74 gboolean adjust_idle_for_delay
;
77 typedef void (JabberPresenceHandler
)(JabberStream
*js
, JabberPresence
*presence
,
78 PurpleXmlNode
*child
);
79 void jabber_presence_register_handler(const char *node
, const char *xmlns
,
80 JabberPresenceHandler
*handler
);
82 void jabber_presence_init(void);
83 void jabber_presence_uninit(void);
85 void jabber_set_status(PurpleAccount
*account
, PurpleStatus
*status
);
88 * Send a full presence stanza.
90 * @param js A JabberStream object.
91 * @param force Force sending the presence stanza, irrespective of whether
92 * the contents seem to have changed.
94 void jabber_presence_send(JabberStream
*js
, gboolean force
);
96 PurpleXmlNode
*jabber_presence_create_js(JabberStream
*js
, JabberBuddyState state
, const char *msg
, int priority
);
97 void jabber_presence_parse(JabberStream
*js
, PurpleXmlNode
*packet
);
98 void jabber_presence_subscription_set(JabberStream
*js
, const char *who
,
100 void jabber_presence_fake_to_self(JabberStream
*js
, PurpleStatus
*status
);
101 void purple_status_to_jabber(const PurpleStatus
*status
, JabberBuddyState
*state
, char **msg
, int *priority
);
103 #endif /* PURPLE_JABBER_PRESENCE_H_ */