summary refs log tree commit diff
path: root/ui.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-29 01:03:46 -0500
committerJune McEnroe <june@causal.agency>2020-02-29 01:03:46 -0500
commit8570a62235e5e9b6a6d719fd8b92cedc91a1d511 (patch)
tree209a365efebcec4457f4563a4308e6c5c8cdfdf4 /ui.c
parentAdd raw modes to mode message (diff)
downloadcatgirl-8570a62235e5e9b6a6d719fd8b92cedc91a1d511.tar.gz
catgirl-8570a62235e5e9b6a6d719fd8b92cedc91a1d511.zip
Implement the causal.agency/consumer capability
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ui.c b/ui.c
index d6f79c2..b3f3b09 100644
--- a/ui.c
+++ b/ui.c
@@ -960,7 +960,8 @@ void uiRead(void) {
 
 static const time_t Signatures[] = {
 	0x6C72696774616301, // no heat, unread, unreadWarm
-	0x6C72696774616302,
+	0x6C72696774616302, // no self.pos
+	0x6C72696774616303,
 };
 
 static size_t signatureVersion(time_t signature) {
@@ -981,7 +982,8 @@ int uiSave(const char *name) {
 	FILE *file = dataOpen(name, "w");
 	if (!file) return -1;
 
-	if (writeTime(file, Signatures[1])) return -1;
+	if (writeTime(file, Signatures[2])) return -1;
+	if (writeTime(file, self.pos)) return -1;
 	for (uint num = 0; num < windows.len; ++num) {
 		const struct Window *window = windows.ptrs[num];
 		if (writeString(file, idNames[window->id])) return -1;
@@ -1032,6 +1034,10 @@ void uiLoad(const char *name) {
 	}
 	size_t version = signatureVersion(signature);
 
+	if (version > 1) {
+		self.pos = readTime(file);
+	}
+
 	char *buf = NULL;
 	size_t cap = 0;
 	while (0 < readString(file, &buf, &cap)) {
1-07-08 16:02:18 -0400'>2021-07-08Use seprintf to build final 005June McEnroe 2021-06-19Fix LDADD.crypt on DarwinJune McEnroe 2021-06-18Add -m mode option to set user modesJune McEnroe 2021-06-18Document channel keys in join optionJune McEnroe 2021-06-18Use | to separate flags from config optionsJune McEnroe 2021-06-18Stop referring to server-time as IRCv3.2June McEnroe 2021-06-17Add mailing list archive to READMEJune McEnroe 2021-06-10Stop accumulating ISUPPORT tokens once MOTD startsJune McEnroe 2021-06-09Use seprintf for snip, removing strlcpynJune McEnroe 2021-06-09Use seprintf for reserializeJune McEnroe 2021-06-09Use seprintf for capListJune McEnroe 2021-06-09Add seprintfJune McEnroe 2021-05-27Add pounce-notify to README 2.4June McEnroe 2021-05-27Fix ENVIRONMENT formatting in pounce-notify(1)June McEnroe 2021-05-27Add note about Libera.Chat SASL-only rangesJune McEnroe 2021-05-25Add QUIRKS fileJune McEnroe 2021-05-19Replace freenode with tilde.chatJune McEnroe 2021-05-04notify: Reword pounce-notify manualJune McEnroe 2021-05-02Clean up Makefiles, configure scriptsJune McEnroe 2021-04-30palaver: Exit on getopt failureJune McEnroe 2021-04-30notify: Implement pounce-notifyJune McEnroe