From bf05c5f795163368c427aebfc1a4ffa848413014 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Mon, 11 Feb 2013 17:17:49 -0500 Subject: [PATCH] Subscribe by default to new releases and announcements --- bitmessagemain.py | 2 +- messages.dat reader.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bitmessagemain.py b/bitmessagemain.py index 8240f795..a264b9aa 100644 --- a/bitmessagemain.py +++ b/bitmessagemain.py @@ -2158,7 +2158,7 @@ class sqlThread(QThread): self.cur.execute( '''CREATE TABLE pubkeys (hash blob, havecorrectnonce bool, transmitdata blob, time blob, usedpersonally text, UNIQUE(hash, havecorrectnonce, transmitdata) ON CONFLICT REPLACE)''' ) self.cur.execute( '''CREATE TABLE inventory (hash blob, objecttype text, streamnumber int, payload blob, receivedtime integer, UNIQUE(hash) ON CONFLICT REPLACE)''' ) self.cur.execute( '''CREATE TABLE knownnodes (timelastseen int, stream int, services blob, host blob, port blob, UNIQUE(host, stream, port) ON CONFLICT REPLACE)''' ) #This table isn't used in the program yet but I have a feeling that we'll need it. - + self.cur.execute( '''INSERT INTO subscriptions VALUES('Bitmessage new release/announcements','BM-BbkPSZbzPwpVcYZpU4yHwf9ZPEapN5Zx',1)''') self.conn.commit() print 'Created messages database file' except Exception, err: diff --git a/messages.dat reader.py b/messages.dat reader.py index 0778111a..2d56a893 100644 --- a/messages.dat reader.py +++ b/messages.dat reader.py @@ -41,6 +41,15 @@ def readSent(): for row in output: print row +def readSubscriptions(): + print 'Printing everything in subscriptions table:' + item = '''select * from subscriptions''' + parameters = '' + cur.execute(item, parameters) + output = cur.fetchall() + for row in output: + print row + def readPubkeys(): print 'Printing everything in pubkeys table:' item = '''select hash, havecorrectnonce, transmitdata, time, usedpersonally from pubkeys''' @@ -71,6 +80,7 @@ def takeSentMessagesOutOfTrash(): #takeSentMessagesOutOfTrash() #readInbox() #readSent() -readPubkeys() +#readPubkeys() +readSubscriptions() -- 2.45.1