Finished implementation of new tweet and reply calls in buffers

This commit is contained in:
Manuel Cortez 2021-11-09 13:46:36 -06:00
parent 15d0f4c65e
commit 8fed52118f
2 changed files with 13 additions and 2 deletions

View File

@ -84,7 +84,6 @@ class BaseBuffer(base.Buffer):
return _(u"Unknown buffer") return _(u"Unknown buffer")
def post_status(self, *args, **kwargs): def post_status(self, *args, **kwargs):
item = None
title = _("Tweet") title = _("Tweet")
caption = _("Write the tweet here") caption = _("Write the tweet here")
tweet = messages.tweet(self.session, title, caption, "") tweet = messages.tweet(self.session, title, caption, "")

View File

@ -4,7 +4,7 @@ import platform
if platform.system() == "Windows": if platform.system() == "Windows":
import wx import wx
from wxUI import buffers, commonMessageDialogs, menus from wxUI import buffers, commonMessageDialogs, menus
from controller import user from controller import user, messages
elif platform.system() == "Linux": elif platform.system() == "Linux":
from gi.repository import Gtk from gi.repository import Gtk
from gtkUI import buffers, commonMessageDialogs from gtkUI import buffers, commonMessageDialogs
@ -38,6 +38,18 @@ class TrendsBuffer(base.Buffer):
self.get_formatted_message = self.get_message self.get_formatted_message = self.get_message
self.reply = self.search_topic self.reply = self.search_topic
def post_status(self, *args, **kwargs):
title = _("Tweet")
caption = _("Write the tweet here")
tweet = messages.tweet(self.session, title, caption, "")
response = tweet.message.ShowModal()
if response == wx.ID_OK:
tweet_data = tweet.get_tweet_data()
call_threaded(self.session.send_tweet, *tweet_data)
if hasattr(tweet.message, "destroy"):
tweet.message.destroy()
def start_stream(self, mandatory=False, play_sound=True, avoid_autoreading=False): def start_stream(self, mandatory=False, play_sound=True, avoid_autoreading=False):
# starts stream every 3 minutes. # starts stream every 3 minutes.
current_time = time.time() current_time = time.time()