Skip to content

Instantly share code, notes, and snippets.

@tsutsui
Created June 12, 2019 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsutsui/6c3208e9b260836eba4637e4dd2ae374 to your computer and use it in GitHub Desktop.
Save tsutsui/6c3208e9b260836eba4637e4dd2ae374 to your computer and use it in GitHub Desktop.
dumb diff against mikutter-uwm-hommage to support mikutter 3.9.0-develop
diff --git a/postbox.rb b/postbox.rb
index f0854f3..4599c65 100644
--- a/postbox.rb
+++ b/postbox.rb
@@ -93,9 +93,9 @@ class Gtk::PostBox
end
# 投稿処理
- def uwm_post(text, mediaiolist)
+ def uwm_post(text, mediaiolist, world)
@posting = Plugin[:gtk].compose(
- current_world,
+ world,
to_display_only? ? nil : @to.first,
body: text,
visibility: @visibility,
@@ -110,9 +110,11 @@ class Gtk::PostBox
end
# 投稿
- def post_it
+ # ==== Args
+ # [world:] 投稿先のWorld。省略するかnilを渡すと :world_current フィルタの結果が使われる
+ def post_it(world: target_world)
if postable?
- return unless before_post
+ return unless before_post(world: world || target_world)
text = widget_post.buffer.text
text += UserConfig[:footer] if use_blind_footer?
image_widget = self.extra_widget(:image)
@@ -121,7 +123,7 @@ class Gtk::PostBox
if Environment::VERSION < [3, 6, 0, 0]
uwm_post_3_5(text, mediaiolist)
else
- uwm_post(text, mediaiolist)
+ uwm_post(text, mediaiolist, world || target_world)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment