File: xmpp-servers.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 (66 lines) | stat: -rw-r--r-- 1,438 bytes parent folder | download | duplicates (4)
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
#ifndef __XMPP_SERVERS_H
#define __XMPP_SERVERS_H

#include "chat-protocols.h"
#include "servers.h"

#include "loudmouth/loudmouth.h"
#include "loudmouth-tools.h"

#define XMPP_PROXY_HTTP "http"

/* returns XMPP_SERVER_REC if it's XMPP server, NULL if it isn't */
#define XMPP_SERVER(server)						\
	PROTO_CHECK_CAST(SERVER(server), XMPP_SERVER_REC, chat_type, "XMPP")

#define XMPP_SERVER_CONNECT(conn)					\
	PROTO_CHECK_CAST(SERVER_CONNECT(conn), XMPP_SERVER_CONNECT_REC,	\
	    chat_type, "XMPP")

#define IS_XMPP_SERVER(server)						\
	(XMPP_SERVER(server) ? TRUE : FALSE)

#define IS_XMPP_SERVER_CONNECT(conn)					\
	(XMPP_SERVER_CONNECT(conn) ? TRUE : FALSE) 

struct _XMPP_SERVER_CONNECT_REC {
	#include "server-connect-rec.h"

	GSList		*channels_list;
	int		 show;
	int		 priority;
	char		*real_jid;
	char		*prompted_password;
};

#define STRUCT_SERVER_CONNECT_REC XMPP_SERVER_CONNECT_REC
struct _XMPP_SERVER_REC {
	#include "server-rec.h"

	char		*jid;
	char		*user;
	char		*domain;
	char		*resource;

	int		 show;
	int		 priority;
	char		*ping_id;
	GSList		*server_features;
	GSList		*my_resources;
	GSList		*roster;

	int		 timeout_tag;
	LmConnection	*lmconn;
	GSList		*msg_handlers;
};

__BEGIN_DECLS
SERVER_REC	*xmpp_server_init_connect(SERVER_CONNECT_REC *);
void		 xmpp_server_connect(XMPP_SERVER_REC *);

void xmpp_servers_init(void);
void xmpp_servers_deinit(void);
char *get_password(char *prompt);
__END_DECLS

#endif