From fc8be5db40ee6bdd4852e20bf62beb81b45b8f7a Mon Sep 17 00:00:00 2001 From: Lynne Date: Tue, 17 Sep 2019 18:24:23 +1000 Subject: [PATCH] save bot's instance type in db --- setup.sql | 1 + webui.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.sql b/setup.sql index d38c345..c42361a 100644 --- a/setup.sql +++ b/setup.sql @@ -22,6 +22,7 @@ CREATE TABLE IF NOT EXISTS `bots` ( `push_private_key` BINARY(128) NOT NULL, `push_public_key` BINARY(128) NOT NULL, `push_secret` BINARY(16), + `instance_type` VARCHAR(64) NOT NULL DEFAULT 'Mastodon', `enabled` BOOLEAN DEFAULT 0, `replies_enabled` BOOLEAN DEFAULT 1, `post_frequency` SMALLINT UNSIGNED DEFAULT 30, diff --git a/webui.py b/webui.py index 086fc12..4aef4dd 100644 --- a/webui.py +++ b/webui.py @@ -483,7 +483,7 @@ def bot_create(): secret = privated['auth'] client.push_subscription_set("{}/push/{}".format(cfg['base_uri'], handle), publicd, mention_events = True) - c.execute("INSERT INTO `bots` (handle, user_id, credentials_id, push_public_key, push_private_key, push_secret) VALUES (%s, %s, %s, %s, %s, %s)", (handle, session['user_id'], credentials_id, public, private, secret)) + c.execute("INSERT INTO `bots` (handle, user_id, credentials_id, push_public_key, push_private_key, push_secret, instance_type) VALUES (%s, %s, %s, %s, %s, %s)", (handle, session['user_id'], credentials_id, public, private, secret, session['instance_type'])) mysql.connection.commit() c.close()