aboutsummaryrefslogtreecommitdiffstats
path: root/main/sircbot/0001-add-simple-hack-to-allow-nickserv-identification.patch
blob: 6aeae2698bc42f3295c6a727d7149b9f2ca26828 (plain)
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
From b158567d16bbc82ce289d96456d66e45c8a7154c Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 1 Aug 2018 17:44:16 +0200
Subject: [PATCH] add simple hack to allow nickserv identification

pass -c "nickserv :identify <password>!
---
 sircbot.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sircbot.c b/sircbot.c
index 5a40695..51572c0 100644
--- a/sircbot.c
+++ b/sircbot.c
@@ -608,12 +608,16 @@ int main(int argc, char *argv[])
 	const char *username = "sircbot";
 	const char *pass = NULL;
 	const char *logfile = "/dev/null";
+	const char *connmsg = NULL;
 	struct sircbot_session sb;
 	int i, c, port = 6667, multimode = 0;
 
 	sb.runhooks = 1;
-	while ((c = getopt(argc, argv, "fl:mn:Np:P:r:s:u:")) != -1) {
+	while ((c = getopt(argc, argv, "c:fl:mn:Np:P:r:s:u:")) != -1) {
 		switch (c) {
+		case 'c':
+			connmsg = optarg;
+			break;
 		case 'f':
 			foreground = 1;
 			break;
@@ -698,6 +702,8 @@ int main(int argc, char *argv[])
 			sleep(10);
 			continue;
 		}
+		if (connmsg)
+			irc_send(sb.sess, "PRIVMSG", connmsg);
 
 		irc_loop(&sb);
 		irc_close(sb.sess, "bye");
-- 
2.18.0