summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-03-29 18:23:12 -0400
committerJune McEnroe <june@causal.agency>2022-03-29 18:23:12 -0400
commit057fe476c800d7a8e86af3bc49bd5efff8eba28d (patch)
tree167b6d0799b429a78324725b0a7bf9ebb7213a23
parentSet clientOrigin from bindHost, add dot if necessary (diff)
downloadpounce-057fe476c800d7a8e86af3bc49bd5efff8eba28d.tar.gz
pounce-057fe476c800d7a8e86af3bc49bd5efff8eba28d.zip
Track account name from 900 numeric
-rw-r--r--bounce.h1
-rw-r--r--state.c16
2 files changed, 10 insertions, 7 deletions
diff --git a/bounce.h b/bounce.h
index d714f97..8987e38 100644
--- a/bounce.h
+++ b/bounce.h
@@ -238,6 +238,7 @@ void clientConsume(struct Client *client);
 
 extern bool stateNoNames;
 extern enum Cap stateCaps;
+extern char *stateAccount;
 extern bool stateAway;
 void stateLogin(
 	const char *pass, enum Cap blind, const char *plain,
diff --git a/state.c b/state.c
index c3fc96c..b1d5573 100644
--- a/state.c
+++ b/state.c
@@ -38,6 +38,7 @@
 
 bool stateNoNames;
 enum Cap stateCaps;
+char *stateAccount;
 bool stateAway;
 
 typedef void Handler(struct Message *msg);
@@ -52,6 +53,12 @@ static void require(const struct Message *msg, bool origin, size_t len) {
 	}
 }
 
+static void set(char **field, const char *value) {
+	if (*field) free(*field);
+	*field = strdup(value);
+	if (!*field) err(EX_OSERR, "strdup");
+}
+
 // Maximum size of one AUTHENTICATE message.
 enum { AuthLen = 299 };
 static char plainBase64[BASE64_SIZE(AuthLen)];
@@ -127,7 +134,8 @@ static void handleAuthenticate(struct Message *msg) {
 }
 
 static void handleReplyLoggedIn(struct Message *msg) {
-	(void)msg;
+	require(msg, false, 3);
+	set(&stateAccount, msg->params[2]);
 	serverFormat("CAP END\r\n");
 }
 
@@ -166,12 +174,6 @@ bool stateReady(void) {
 		&& intro.myInfo[0];
 }
 
-static void set(char **field, const char *value) {
-	if (*field) free(*field);
-	*field = strdup(value);
-	if (!*field) err(EX_OSERR, "strdup");
-}
-
 static void handleErrorNicknameInUse(struct Message *msg) {
 	if (self.nick) return;
 	require(msg, false, 2);
nds_with() in Git 1.8.6. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-10Refactor cgit_parse_snapshots_mask()Lukas Fleischer Use Git string lists instead of str{spn,cspn,ncmp}() magic. This significantly improves readability. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-10Disallow use of undocumented snapshot delimitersLukas Fleischer Since the introduction of selective snapshot format configuration in dc3c9b5 (allow selective enabling of snapshots, 2007-07-21), we allowed seven different delimiters for snapshot formats, while the documentation has always been clear about spaces being the only valid delimiter: The value is a space-separated list of zero or more of the values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip". Supporting the undocumented delimiters makes the code unnecessarily complex. Remove them. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-10Replace most uses of strncmp() with prefixcmp()Lukas Fleischer This is a preparation for replacing all prefix checks with either strip_prefix() or starts_with() when Git 1.8.6 is released. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-09README: Fix dependenciesLukas Fleischer * Remove the dependency on Git (which can be obtained automatically when building, using either the Git submodule or `make get-git`). * Use proper upstream names of dependencies. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-08README: Spelling and formatting fixesLukas Fleischer * Several small spelling and capitalization fixes. * Use consistent and better-looking formatting that is compatible with AsciiDoc (and partly compatible with RST). Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch Previously the script tried to encode output from Pygments with the ASCII codec, which failed. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Add a suggestion to the manpagePřemysl Janouch So that people wishing to use "enable-http-clone" don't have to find out the correct settings on their own. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix the example configurationPřemysl Janouch "enable-git-clone" doesn't exist, replaced with "enable-http-clone". Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix about-formatting.shPřemysl Janouch dash failed to parse the script. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix some spelling errorsPřemysl Janouch Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts