summaryrefslogtreecommitdiff
path: root/functions.h
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-06-17 01:46:28 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-06-17 01:46:28 +0100
commitc70cd5cccc966a35f175913f2281ce251fd62425 (patch)
treecd95e1bbb28ad4df94db87b9e3080cb05d00645b /functions.h
parentfa37193c83f82784e826b8477ee7d4a4cd96d7cf (diff)
Implement a per-client identifier so auto replay can replay everything a given client has missed.
Diffstat (limited to 'functions.h')
-rw-r--r--functions.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/functions.h b/functions.h
index c91bfdc..29ebff5 100644
--- a/functions.h
+++ b/functions.h
@@ -103,7 +103,7 @@ int sendtoserver(SSL *server_ssl, char *strsrc, int str_len, int clientfd, struc
// it from the array of clients.
// Also set its authentication and registration statuses to 0.
// Also set the pending statuses to 0
-int disconnectclient(int fd, struct client *clients, struct ircdstate *ircdstate, struct settings *settings);
+int disconnectclient(int fd, struct client *clients, struct ircdstate *ircdstate, struct settings *settings, struct clientcodes *clientcodes);
int createchannel(struct channel *channels, char *name, char *topic, char *topicwho, char *topicwhen);
@@ -166,4 +166,16 @@ int rehash(struct settings *settings, char *failuremsg);
// Return 0 for password mismatch, or 1 for password match.
int checkpassword(char *password, struct settings *settings);
+// Adds a client code to the clientcode structure if it doesn't already exist.
+// On success, copy it to the client's clientcode field.
+// Returns 1 on adding a new code, 0 if the code already existed, or -1 on error.
+int addclientcode(int sourcefd, char *code, struct clientcodes *clientcodes, struct client *clients);
+
+// Sets a given client code as last disconnecting at the current time.
+// Returns 1 on success or 0 on failure.
+int setclientcodetime(char *code, struct clientcodes *clientcodes);
+
+// Return the timestamp that a given client last disconnected, or 0 on failure.
+int getclientcodetime(char *code, struct clientcodes *clientcodes);
+
#endif