mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-08-26 09:59:23 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
b9a9bd03c2 | |||
e6543bcf77 | |||
03b61946f8 | |||
8fe2f4c64d |
@@ -15,10 +15,10 @@ SetCompressor /solid lzma
|
||||
SetDatablockOptimize on
|
||||
VIAddVersionKey ProductName "TWBlue Snapshot version"
|
||||
VIAddVersionKey LegalCopyright "Copyright 2014-2021 Manuel Cortéz."
|
||||
VIAddVersionKey ProductVersion "7"
|
||||
VIAddVersionKey FileVersion "7"
|
||||
VIProductVersion "7.0.0.0"
|
||||
VIFileVersion "7.0.0.0"
|
||||
VIAddVersionKey ProductVersion "8"
|
||||
VIAddVersionKey FileVersion "8"
|
||||
VIProductVersion "8.0.0.0"
|
||||
VIFileVersion "8.0.0.0"
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!define MUI_LICENSEPAGE_RADIOBUTTONS
|
||||
!insertmacro MUI_PAGE_LICENSE "license.txt"
|
||||
@@ -72,8 +72,8 @@ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "D
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall" "InstallLocation" $INSTDIR
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall" "Publisher" "Manuel Cortéz"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "DisplayVersion" "7"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "URLInfoAbout" "http://twblue.es"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "DisplayVersion" "8"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "URLInfoAbout" "https://twblue.es"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "VersionMajor" 0
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "VersionMinor" 0
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\twblue" "NoModify" 1
|
||||
|
@@ -9,7 +9,7 @@ if snapshot == False:
|
||||
update_url = 'https://twblue.es/updates/stable.php'
|
||||
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/stable.json'
|
||||
else:
|
||||
version = "7"
|
||||
version = "8"
|
||||
update_url = 'https://twblue.es/updates/snapshot.php'
|
||||
mirror_update_url = 'https://raw.githubusercontent.com/manuelcortez/TWBlue/next-gen/updates/snapshots.json'
|
||||
authors = ["Manuel Cortéz", "José Manuel Delicado"]
|
||||
|
@@ -440,7 +440,7 @@ class Controller(object):
|
||||
log.error("A buffer for the %s search term is already created. You can't create a duplicate buffer." % (term,))
|
||||
return
|
||||
elif dlg.get("users") == True:
|
||||
search = buffers.twitter.SearchBuffer(self.view.nb, "search_users", "%s-searchUser" % (term,), buffer.session, buffer.session.db["user_name"], bufferType=None, sound="search_updated.ogg", q=term)
|
||||
search = buffers.twitter.SearchPeopleBuffer(self.view.nb, "search_users", "%s-searchUser" % (term,), buffer.session, buffer.session.db["user_name"], bufferType=None, sound="search_updated.ogg", q=term)
|
||||
search.start_stream(mandatory=True)
|
||||
pos=self.view.search("searches", buffer.session.db["user_name"])
|
||||
self.insert_buffer(search, pos)
|
||||
|
@@ -504,13 +504,18 @@ class Session(base.baseSession):
|
||||
self.db["users"] = users
|
||||
|
||||
def start_streaming(self):
|
||||
self.stream_listener = streaming.StreamListener(twitter_api=self.twitter, user=self.db["user_name"], user_id=self.db["user_id"])
|
||||
if config.app["app-settings"]["no_streaming"]:
|
||||
return
|
||||
self.stream_listener = streaming.StreamListener(twitter_api=self.twitter, user=self.db["user_name"], user_id=self.db["user_id"], muted_users=self.db["muted_users"])
|
||||
self.stream = streaming.Stream(auth = self.auth, listener=self.stream_listener, chunk_size=1025)
|
||||
self.stream_thread = call_threaded(self.stream.filter, follow=self.stream_listener.users, stall_warnings=True)
|
||||
|
||||
def stop_streaming(self):
|
||||
self.stream.running = False
|
||||
log.debug("Stream stopped for accounr {}".format(self.db["user_name"]))
|
||||
if config.app["app-settings"]["no_streaming"]:
|
||||
return
|
||||
if hasattr(self, "stream"):
|
||||
self.stream.running = False
|
||||
log.debug("Stream stopped for accounr {}".format(self.db["user_name"]))
|
||||
|
||||
def handle_new_status(self, status, user):
|
||||
""" Handles a new status present in the Streaming API. """
|
||||
@@ -555,6 +560,10 @@ class Session(base.baseSession):
|
||||
pub.sendMessage("newTweet", data=status, user=self.db["user_name"], _buffers=buffers_to_send)
|
||||
|
||||
def check_streams(self):
|
||||
if config.app["app-settings"]["no_streaming"]:
|
||||
return
|
||||
if not hasattr(self, "stream"):
|
||||
return
|
||||
log.debug("Status of running stream for user {}: {}".format(self.db["user_name"], self.stream.running))
|
||||
if self.stream.running == False:
|
||||
self.start_streaming()
|
||||
|
@@ -14,14 +14,23 @@ log = logging.getLogger("sessions.twitter.streaming")
|
||||
|
||||
class StreamListener(tweepy.StreamListener):
|
||||
|
||||
def __init__(self, twitter_api, user, user_id, *args, **kwargs):
|
||||
def __init__(self, twitter_api, user, user_id, muted_users=[], *args, **kwargs):
|
||||
super(StreamListener, self).__init__(*args, **kwargs)
|
||||
log.debug("Starting streaming listener for account {}".format(user))
|
||||
self.started = False
|
||||
self.users = []
|
||||
self.api = twitter_api
|
||||
self.user = user
|
||||
self.user_id = user_id
|
||||
self.users = [str(id) for id in self.api.friends_ids()]
|
||||
friends = self.api.friends_ids()
|
||||
log.debug("Retrieved {} friends to add to the streaming listener.".format(len(friends)))
|
||||
self.users.append(str(self.user_id))
|
||||
log.debug("Started streaming object for user {}".format(self.user))
|
||||
log.debug("Got {} muted users.".format(len(muted_users)))
|
||||
for user in friends:
|
||||
if user not in muted_users:
|
||||
self.users.append(str(user))
|
||||
self.started = True
|
||||
log.debug("Streaming listener started with {} users to follow.".format(len(self.users)))
|
||||
|
||||
def on_connect(self):
|
||||
pub.sendMessage("streamConnected", user=self.user)
|
||||
|
@@ -168,7 +168,7 @@ def is_allowed(tweet, settings, buffer_name):
|
||||
tweet_data = {}
|
||||
if hasattr(tweet, "retweeted_status"):
|
||||
tweet_data["retweet"] = True
|
||||
if tweet.in_reply_to_status_id != None:
|
||||
if hasattr(tweet, "in_reply_to_status_id"):
|
||||
tweet_data["reply"] = True
|
||||
if hasattr(tweet, "quoted_status"):
|
||||
tweet_data["quote"] = True
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{"current_version": "7",
|
||||
{"current_version": "8",
|
||||
"description": "Snapshot version.",
|
||||
"date": "unknown",
|
||||
"downloads":
|
||||
{"Windows32": "https://twblue.es/pubs/twblue_snapshot_x86.zip"},
|
||||
{"Windows64": "https://twblue.es/pubs/twblue_snapshot_x64.zip"}
|
||||
{"Windows32": "https://twblue.es/pubs/twblue_snapshot_x86.zip",
|
||||
{"Windows64": "https://twblue.es/pubs/twblue_snapshot_x64.zip"
|
||||
}
|
Reference in New Issue
Block a user