File: muc.h

package info (click to toggle)
irssi-plugin-xmpp 0.54-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,952 kB
  • sloc: ansic: 8,831; makefile: 113; perl: 58
file content (73 lines) | stat: -rw-r--r-- 2,166 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef __MUC_H
#define __MUC_H

#include "channels.h"
#include "channels-setup.h"
#include "xmpp-servers.h"
#include "tools.h"

#define XMLNS_MUC	"http://jabber.org/protocol/muc"
#define XMLNS_MUC_USER	"http://jabber.org/protocol/muc#user"
#define XMLNS_MUC_OWNER	"http://jabber.org/protocol/muc#owner"
#define XMLNS_MUC_ADMIN	"http://jabber.org/protocol/muc#admin"

#define muc_extract_nick(jid)						\
	xmpp_extract_resource(jid)
#define muc_extract_channel(jid)					\
	xmpp_strip_resource(jid)

#define MUC_SETUP(chansetup) \
	PROTO_CHECK_CAST(CHANNEL_SETUP(chansetup), CHANNEL_SETUP_REC, chat_type, "XMPP")

#define IS_MUC_SETUP(chansetup) \
	(MUC_SETUP(chansetup) ? TRUE : FALSE)

/* Returns MUC_REC if it's XMPP channel, NULL if it isn't. */
#define MUC(channel) 							\
	PROTO_CHECK_CAST(CHANNEL(channel), MUC_REC, chat_type, "XMPP")

#define IS_MUC(channel) 						\
	(MUC(channel) ? TRUE : FALSE)

#define muc_find(server, name) 						\
	MUC(channel_find(SERVER(server), name))

#define STRUCT_SERVER_REC XMPP_SERVER_REC
struct _MUC_REC {
	#include "channel-rec.h"

	char	*nick;
};

enum {
	MUC_ERROR_UNKNOWN,
	MUC_ERROR_PASSWORD_INVALID_OR_MISSING	= 401,
	MUC_ERROR_USER_BANNED			= 403,
	MUC_ERROR_ROOM_NOT_FOUND		= 404,
	MUC_ERROR_ROOM_CREATION_RESTRICTED	= 405,
	MUC_ERROR_USE_RESERVED_ROOM_NICK	= 406,
	MUC_ERROR_NOT_ON_MEMBERS_LIST		= 407,
	MUC_ERROR_NICK_IN_USE			= 409,
	MUC_ERROR_MAXIMUM_USERS_REACHED		= 503,
};

__BEGIN_DECLS

void muc_destroy(XMPP_SERVER_REC *, MUC_REC *, const char *, const char *);
void muc_join(XMPP_SERVER_REC *, const char *, gboolean);
void muc_part(MUC_REC *, const char *);
void muc_nick(MUC_REC *, const char *);
void muc_get_affiliation(XMPP_SERVER_REC *, MUC_REC *, const char *);
void muc_set_affiliation(XMPP_SERVER_REC *, MUC_REC *, const char *,
		const char *, const char *);
void muc_get_role(XMPP_SERVER_REC *, MUC_REC *, const char *);
void muc_set_role(XMPP_SERVER_REC *, MUC_REC *, const char *,
		const char *, const char *);
void muc_set_mode(XMPP_SERVER_REC *, MUC_REC *, const char *);
MUC_REC	*get_muc(XMPP_SERVER_REC *, const char *);

void muc_init(void);
void muc_deinit(void);
__END_DECLS

#endif