- CF7A79184DC4F229361A26A8DB0901BBCC915EC3C46C7D8A41177A5DDA82E50AACA1AB94C324239251EC1FC148B6C14CB9FB967D4EB08223FA6679D15BAC599A
+ ACD5EAFFDBA356D5B2B2E0CE494E3BE8AED35CCF0B96F9605BFD73FD3F758286F1908D043274A5480AC02C2D270550E1B061B32C0856E521A4EABA2F9F6B29F3
blatta/lib/state.py
(35 . 6)(35 . 10)
198 message_bytes blob not null,\
199 created_at datetime default current_timestamp)")
200
201 self.cursor.execute("create table if not exists dedup_queue(\
202 hash text not null,\
203 created_at datetime default current_timestamp)")
204
205 def get_at(self, handle=None):
206 at = []
207 if handle == None:
(60 . 6)(64 . 22)
209 return at
210
211
212 def is_duplicate_message(self, message_hash):
213 self.cursor.execute("delete from dedup_queue where created_at < datetime(current_timestamp, '-1 hour')")
214 self.conn.commit()
215 result = self.cursor.execute("select hash from dedup_queue where hash=?",
216 (message_hash,)).fetchone()
217 if(result != None):
218 return True
219 else:
220 return False
221
222 def add_to_dedup_queue(self, message_hash):
223 self.cursor.execute("insert into dedup_queue(hash)\
224 values(?)",
225 (message_hash,))
226 self.conn.commit()
227
228 def get_last_message_hash(self, handle, peer_id=None):
229 if peer_id:
230 message_bytes = self.cursor.execute("select message_bytes from logs\