-
Notifications
You must be signed in to change notification settings - Fork 0
/
file-backend.c
60 lines (49 loc) · 1.19 KB
/
file-backend.c
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
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include "array.h"
#include "backend.h"
#include "vink-internal.h"
#include "vink-tree.h"
static const char *spool_path;
static void
email_message (struct vink_message *message)
{
vink_message_free (message);
}
static int
xmpp_authenticate (const char *authzid, const char *user, const char *secret)
{
return 0;
}
static void
xmpp_message (struct vink_xmpp_state *state, struct vink_message *message)
{
email_message (message);
}
static void
xmpp_presence (struct vink_xmpp_state *state, const char *jid,
enum vink_presence presence)
{
fprintf (stderr, "Got presence for %s\n", jid);
}
static void
xmpp_queue_empty (struct vink_xmpp_state *state)
{
fprintf (stderr, "Queue is empty\n");
}
void
backend_file_init (struct vink_backend_callbacks *callbacks)
{
callbacks->xmpp.authenticate = xmpp_authenticate;
callbacks->xmpp.message = xmpp_message;
callbacks->xmpp.presence = xmpp_presence;
callbacks->xmpp.queue_empty = xmpp_queue_empty;
callbacks->email.message = email_message;
spool_path = vink_config ("backend.spool-path");
}