summaryrefslogtreecommitdiffstats
path: root/src/irc/dcc/dcc-chat.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:18:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:18:39 +0000
commitfff5217f02d91268ce90c8c05665602c059faaef (patch)
tree2ba24d32dc96eafe7ed0a85269548e76796d849d /src/irc/dcc/dcc-chat.h
parentInitial commit. (diff)
downloadirssi-fff5217f02d91268ce90c8c05665602c059faaef.tar.xz
irssi-fff5217f02d91268ce90c8c05665602c059faaef.zip
Adding upstream version 1.4.5.upstream/1.4.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/irc/dcc/dcc-chat.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/irc/dcc/dcc-chat.h b/src/irc/dcc/dcc-chat.h
new file mode 100644
index 0000000..ef992bb
--- /dev/null
+++ b/src/irc/dcc/dcc-chat.h
@@ -0,0 +1,40 @@
+#ifndef IRSSI_IRC_DCC_DCC_CHAT_H
+#define IRSSI_IRC_DCC_DCC_CHAT_H
+
+#include <irssi/src/irc/dcc/dcc.h>
+
+#define DCC_CHAT(dcc) \
+ MODULE_CHECK_CAST_MODULE(dcc, CHAT_DCC_REC, type, "DCC", "CHAT")
+
+#define IS_DCC_CHAT(dcc) \
+ (DCC_CHAT(dcc) ? TRUE : FALSE)
+
+struct CHAT_DCC_REC {
+#include <irssi/src/irc/dcc/dcc-rec.h>
+
+ char *id; /* unique identifier - usually same as nick. */
+ NET_SENDBUF_REC *sendbuf;
+
+ unsigned int mirc_ctcp:1; /* Send CTCPs without the CTCP_MESSAGE prefix */
+ unsigned int connection_lost:1; /* other side closed connection */
+};
+
+#define DCC_CHAT_TYPE module_get_uniq_id_str("DCC", "CHAT")
+
+CHAT_DCC_REC *dcc_chat_find_id(const char *id);
+
+/* Send `data' to dcc chat. */
+void dcc_chat_send(CHAT_DCC_REC *dcc, const char *data);
+
+/* Send a CTCP message/notify to target.
+ Send the CTCP via DCC chat if `chat' is specified. */
+void dcc_ctcp_message(IRC_SERVER_REC *server, const char *target,
+ CHAT_DCC_REC *chat, int notice, const char *msg);
+
+/* If `item' is a query of a =nick, return DCC chat record of nick */
+CHAT_DCC_REC *item_get_dcc(WI_ITEM_REC *item);
+
+void dcc_chat_init(void);
+void dcc_chat_deinit(void);
+
+#endif