mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 04:48:09 -06:00
Updated code for handler
This commit is contained in:
parent
b39ccb9f2c
commit
10d2c47f9a
@ -362,15 +362,22 @@ class Handler(object):
|
|||||||
dlg = showUserProfile.ShowUserProfile(user)
|
dlg = showUserProfile.ShowUserProfile(user)
|
||||||
dlg.ShowModal()
|
dlg.ShowModal()
|
||||||
|
|
||||||
def new_community_buffer(self, buffer, *args, **kwargs):
|
def new_community_buffer(self, controller, buffer):
|
||||||
dlg = communityTimeline.CommunityTimeline()
|
dlg = communityTimeline.CommunityTimeline()
|
||||||
if dlg.ShowModal() != wx.ID_OK:
|
if dlg.ShowModal() != wx.ID_OK:
|
||||||
return
|
return
|
||||||
url = dlg.url.GetValue()
|
url = dlg.url.GetValue()
|
||||||
bufftype = dlg.get_action()
|
bufftype = dlg.get_action()
|
||||||
|
if bufftype == "local":
|
||||||
|
title = _(f"Local timeline for {url}")
|
||||||
|
else:
|
||||||
|
title = _(f"Federated timeline for {url}")
|
||||||
|
bufftype = "public"
|
||||||
dlg.Destroy()
|
dlg.Destroy()
|
||||||
tl_info = f"{bufftype}@{url}"
|
tl_info = f"{bufftype}@{url}"
|
||||||
if tl_info in buffer.session.settings["other_buffers"]["communities"]:
|
if tl_info in buffer.session.settings["other_buffers"]["communities"]:
|
||||||
return # buffer already exists.
|
return # buffer already exists.
|
||||||
buffer.session.settings["other_buffers"]["communities"].append(tl_info)
|
buffer.session.settings["other_buffers"]["communities"].append(tl_info)
|
||||||
buffer.session.settings.write()
|
buffer.session.settings.write()
|
||||||
|
communities_position =controller.view.search("communities", buffer.session.get_name())
|
||||||
|
pub.sendMessage("createBuffer", buffer_type="CommunityBuffer", session_type=buffer.session.type, buffer_title=title, parent_tab=communities_position, start=True, kwargs=dict(parent=controller.view.nb, function="timeline", name=tl_info, sessionObject=buffer.session, account=buffer.session.get_name(), sound="tweet_timeline.ogg", community_url=url, timeline=bufftype))
|
||||||
|
Loading…
Reference in New Issue
Block a user