From 0b83866013646258f3eb069788c20e3547a87890 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 27 Apr 2021 20:20:10 +0000 Subject: palaver: Drop no longer used network field --- contrib/palaver/notify.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/contrib/palaver/notify.c b/contrib/palaver/notify.c index e41f708..88606ae 100644 --- a/contrib/palaver/notify.c +++ b/contrib/palaver/notify.c @@ -148,7 +148,6 @@ static void dbInit(void) { port INTEGER NOT NULL, client TEXT NOT NULL, version TEXT NOT NULL, - network TEXT, UNIQUE (host, port, client) ); CREATE TABLE IF NOT EXISTS preferences ( @@ -348,10 +347,10 @@ static const char *Queries[QueriesLen] = { ), [End] = SQL( - INSERT INTO clients (host, port, client, version, network) - VALUES (:host, :port, :client, :version, :network) + INSERT INTO clients (host, port, client, version) + VALUES (:host, :port, :client, :version) ON CONFLICT (host, port, client) DO - UPDATE SET version = :version, network = :network + UPDATE SET version = :version WHERE host = :host AND port = :port AND client = :client; ), @@ -391,8 +390,7 @@ static const char *Queries[QueriesLen] = { SELECT pushToken.value, pushEndpoint.value, - coalesce(showMessagePreview.value, 'true'), - clients.network + coalesce(showMessagePreview.value, 'true') FROM clients JOIN matches USING (client) JOIN preferences AS pushToken USING (client) @@ -413,7 +411,6 @@ static void palaverIdentify(struct Message *msg) { int result = sqlite3_step(stmts[Identify]); if (result == SQLITE_DONE) { format("PALAVER REQ\r\n"); - dbBindCopy(stmts[End], ":network", msg->params[3]); } else if (result != SQLITE_ROW) { errx(EX_SOFTWARE, "%s", sqlite3_errmsg(db)); } @@ -533,7 +530,7 @@ static void handleReplyUnaway(struct Message *msg) { static bool noPreview; static bool noPrivatePreview; -static char *jsonBody(struct Message *msg, const char *network, bool preview) { +static char *jsonBody(struct Message *msg, bool preview) { bool private = (msg->params[0][0] != '#'); if (private && noPrivatePreview) preview = false; if (noPreview) preview = false; @@ -550,10 +547,6 @@ static char *jsonBody(struct Message *msg, const char *network, bool preview) { fprintf(file, ",\"channel\":"); jsonString(file, msg->params[0]); } - if (network) { - fprintf(file, ",\"network\":"); - jsonString(file, network); - } if (preview) { if (!strncmp(msg->params[1], "\1ACTION ", 8)) { size_t len = strlen(msg->params[1]); @@ -598,13 +591,12 @@ static void handlePrivmsg(struct Message *msg) { const char *token = sqlite3_column_text(stmts[Notify], i++); const char *endpoint = sqlite3_column_text(stmts[Notify], i++); const char *preview = sqlite3_column_text(stmts[Notify], i++); - const char *network = sqlite3_column_text(stmts[Notify], i++); if (!badged) { badge++; badged = true; } - char *body = jsonBody(msg, network, !strcmp(preview, "true")); + char *body = jsonBody(msg, !strcmp(preview, "true")); pushNotify(endpoint, token, body); free(body); } -- cgit 1.4.1 ss='nohover-highlight'> In preparation for multi-channel? 2018-08-09Add -u option for setting userJune McEnroe 2018-08-09Color brackets around nicksJune McEnroe Also switch self-brackets to () since [] can appear in nicks. 2018-08-09Fix 432 handler paramsJune McEnroe 2018-08-09Add M-b, M-f, M-DEL, M-d, C-wJune McEnroe 2018-08-09Add PASS optionJune McEnroe WEBIRC is now -W. 2018-08-09Ignore trailing space on slash commandsJune McEnroe 2018-08-09Replace shift with a great variadic functionJune McEnroe I am disappointed in the lack of compiler attributes for type-checking variadic functions. 2018-08-09Only tabTouch nick if not selfJune McEnroe 2018-08-09Add URL detection, listing and openingJune McEnroe Might also add /copy, like /open. 2018-08-08Add commands to tab completeJune McEnroe 2018-08-08Use blank line as unread markerJune McEnroe 2018-08-08Add Homebrew LibreSSL paths to MakefileJune McEnroe 2018-08-08Distinguish self with square bracketsJune McEnroe 2018-08-08Add markers as lines to the logJune McEnroe 2018-08-08Factor out line editing to edit.cJune McEnroe 2018-08-08Set log marker on FocusOut eventJune McEnroe All of this needs refactoring, probably separating the line editing out from the actual input handling. 2018-08-08Color own messages 15June McEnroe My own settings have "white" slightly darker than the default color, so this helps to distinguish my own messages. 2018-08-08Use BLACK LEFT-POINTING TRIANGLE for markerJune McEnroe 2018-08-07Reset attrs after addIRCJune McEnroe Otherwise the marker inherits whatever was left on. 2018-08-07Add tab complete UIJune McEnroe This definitely needs refactoring. 2018-08-07Implement cycling tab completeJune McEnroe Not properly hooked up to the UI yet. 2018-08-07Mark log when scrolling upJune McEnroe 2018-08-07Remove extraneous slash from unrecognized commandJune McEnroe 2018-08-07Highlight and beep pingsJune McEnroe 2018-08-07Factor out allocating conversion between wcs and mbsJune McEnroe 2018-08-07Match commands case-insensitivelyJune McEnroe Also include the slash in their names so that they can be added to tab-complete later. 2018-08-07Convert input to multibyte before handlingJune McEnroe 2018-08-07Populate tab-complete listJune McEnroe 2018-08-07Fix /me formatting side-effectsJune McEnroe NEVER pass side-effects to a macro. 2018-08-07Define ui.c BUF_LEN with enumJune McEnroe 2018-08-07Hack clang into checking uiFmt format stringsJune McEnroe 2018-08-07Handle PART and QUIT without messagesJune McEnroe 2018-08-07Make safe filling the who bufferJune McEnroe 2018-08-07Add reverse and reset IRC formatting codesJune McEnroe 2018-08-06Rewrite line editing again, add formattingJune McEnroe 2018-08-06Fix allocation size in vaswprintfJune McEnroe This is so embarrassing. It only started crashing once it had strings that were long enough, and then it took me so long to notice this mistake. I was worried I was still doing va_list wrong somehow. 2018-08-06Implement word wrappingJune McEnroe 2018-08-06Use wchar_t strings for all of UIJune McEnroe vaswprintf is a nightmare. 2018-08-06Rename line editing functionsJune McEnroe 2018-08-05Initialize all possible color pairsJune McEnroe This is actually possible with use_default_colors! 2018-08-05Refactor color initializationJune McEnroe 2018-08-05Add ^L redrawJune McEnroe 2018-08-05Use 16 colors if availableJune McEnroe Fall back to using bold if there are only 8 colors. This also allowed bright background colors in 16-color terminals. I must port this system to torus. I'll be able to remove the awful termcap patch hack. 2018-08-05Limit parsed colors to number of mIRC colorsJune McEnroe Oh boy that's embarrassing. 2018-08-04Show source link on exitJune McEnroe 2018-08-04Implement line editing, scrollingJune McEnroe Don't really have a way to implement the M-* keys, and currently missing C-w. 2018-08-04Handle /topicJune McEnroe