mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-19 00:40:42 -06:00
Double tweets should be ignored in streams
This commit is contained in:
parent
a69bf99c1a
commit
89e39e2168
@ -30,6 +30,9 @@ class timelinesStreamer(TwythonStreamer):
|
|||||||
def check_tls(self, data):
|
def check_tls(self, data):
|
||||||
for i in self.session.settings["other_buffers"]["timelines"]:
|
for i in self.session.settings["other_buffers"]["timelines"]:
|
||||||
if data["user"]["screen_name"] == i:
|
if data["user"]["screen_name"] == i:
|
||||||
|
if utils.find_item(data["id"], self.session.db["%s-timeline" % (i,)]) != None:
|
||||||
|
log.error("duplicated tweet. Ignoring it...")
|
||||||
|
return
|
||||||
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s-timeline" % (i,)].append(data)
|
if self.session.settings["general"]["reverse_timelines"] == False: self.session.db["%s-timeline" % (i,)].append(data)
|
||||||
else: self.session.db["%s-timeline" % (i,)].insert(0, data)
|
else: self.session.db["%s-timeline" % (i,)].insert(0, data)
|
||||||
pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i)
|
pub.sendMessage("item-in-timeline", data= data, user= self.session.db["user_name"], who= i)
|
||||||
|
@ -33,6 +33,9 @@ class streamer(TwythonStreamer):
|
|||||||
|
|
||||||
def put_data(self, place, data):
|
def put_data(self, place, data):
|
||||||
if self.session.db.has_key(place):
|
if self.session.db.has_key(place):
|
||||||
|
if utils.find_item(data["id"], self.session.db[place]) != None:
|
||||||
|
log.error("duplicated tweet. Ignoring it...")
|
||||||
|
return
|
||||||
if self.session.settings["general"]["reverse_timelines"] == False:
|
if self.session.settings["general"]["reverse_timelines"] == False:
|
||||||
self.session.db[place].append(data)
|
self.session.db[place].append(data)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user