diff options
author | Toshiaki Asai <toshi.alternative@gmail.com> | 2017-12-22 07:21:21 +0900 |
---|---|---|
committer | Toshiaki Asai <toshi.alternative@gmail.com> | 2017-12-22 07:21:21 +0900 |
commit | 10ec2897dc9dc0175811516a6dce767e1db54860 (patch) | |
tree | 7b66c21d43e4b4f5cb7497dfb46d2d70b3821eba | |
parent | 5d41a27252c2884c9d2b633cb3557def26e4fc84 (diff) | |
download | mikutter-10ec2897dc9dc0175811516a6dce767e1db54860.tar.gz |
retweet spellをshareに変更 refs #1131
それに伴って、retweetedやdestroy_retweetをsharedとdestroy_shareに変更
-rw-r--r-- | core/mui/cairo_miracle_painter.rb | 6 | ||||
-rw-r--r-- | core/plugin/command/command.rb | 8 | ||||
-rw-r--r-- | core/plugin/command/conditions.rb | 6 | ||||
-rw-r--r-- | core/plugin/twitter/model/message.rb | 6 | ||||
-rw-r--r-- | core/plugin/twitter/twitter.rb | 10 |
5 files changed, 18 insertions, 18 deletions
diff --git a/core/mui/cairo_miracle_painter.rb b/core/mui/cairo_miracle_painter.rb index 9afd92fa..792c8e46 100644 --- a/core/mui/cairo_miracle_painter.rb +++ b/core/mui/cairo_miracle_painter.rb @@ -201,7 +201,7 @@ class Gdk::MiraclePainter < Gtk::Object UserConfig[:show_verified_icon] && message.user.verified? && "verified.png"], [ if UserConfig[:show_protected_icon] and message.user.protected? "protected.png".freeze - elsif Plugin[:miracle_painter].retweeted?(message, world) + elsif Plugin[:miracle_painter].shared?(message, world) "retweet.png".freeze end, message.favorite? ? "unfav.png".freeze : nil] ] @@ -212,11 +212,11 @@ class Gdk::MiraclePainter < Gtk::Object def iob_retweet_clicked world, = Plugin.filtering(:world_current, nil) - if Plugin[:miracle_painter].retweeted?(message, world) + if Plugin[:miracle_painter].shared?(message, world) retweet = message.retweeted_statuses.find(&:from_me?) retweet.destroy if retweet else - Plugin[:miracle_painter].retweet(message, world) + Plugin[:miracle_painter].share(message, world) end end diff --git a/core/plugin/command/command.rb b/core/plugin/command/command.rb index c49788db..a7420c6d 100644 --- a/core/plugin/command/command.rb +++ b/core/plugin/command/command.rb @@ -64,13 +64,13 @@ Plugin.create :command do icon: Skin['retweet.png'], role: :timeline) do |opt| world, = Plugin.filtering(:world_current, nil) - target = opt.messages.select{|m| retweet?(m, world) }.reject{|m| retweeted?(m, world) }.map(&:introducer) + target = opt.messages.select{|m| share?(m, world) }.reject{|m| shared?(m, world) }.map(&:introducer) if target.any?{|message| message.from_me?([world]) } if ::Gtk::Dialog.confirm(_('過去の栄光にすがりますか?')) - target.each{|m| retweet(m, world) } + target.each{|m| share(m, world) } end else - target.each{|m| retweet(m, world) } + target.each{|m| share(m, world) } end end @@ -82,7 +82,7 @@ Plugin.create :command do role: :timeline) do |opt| current_world, = Plugin.filtering(:world_current, nil) Delayer::Deferred.when( - opt.messages.map{|m| destroy_retweet(current_world, m) } + opt.messages.map{|m| destroy_share(current_world, m) } ).terminate(_('リツイートをキャンセルしている途中でエラーが発生しました')) end diff --git a/core/plugin/command/conditions.rb b/core/plugin/command/conditions.rb index 7c09da57..96ee9af4 100644 --- a/core/plugin/command/conditions.rb +++ b/core/plugin/command/conditions.rb @@ -48,7 +48,7 @@ module ::Plugin::Command CanReTweetAny = Condition.new { |opt| current_world, = Plugin.filtering(:world_current, nil) opt.messages.lazy.any?{|m| - Plugin[:command].retweet?(current_world, m) && !Plugin[:command].retweeted?(current_world, m) + Plugin[:command].share?(current_world, m) && !Plugin[:command].shared?(current_world, m) } } @@ -58,7 +58,7 @@ module ::Plugin::Command CanReTweetAll = Condition.new{ |opt| current_world, = Plugin.filtering(:world_current, nil) !opt.messages.empty? && opt.messages.lazy.all?{|m| - Plugin[:command].retweet?(current_world, m) && !Plugin[:command].retweeted?(current_world, m) + Plugin[:command].share?(current_world, m) && !Plugin[:command].shared?(current_world, m) } } @@ -67,7 +67,7 @@ module ::Plugin::Command IsReTweetedAll = Condition.new{ |opt| current_world, = Plugin.filtering(:world_current, nil) !opt.messages.empty? && opt.messages.lazy.all?{|m| - Plugin[:command].destroy_retweet?(current_world, m) + Plugin[:command].destroy_share?(current_world, m) } } diff --git a/core/plugin/twitter/model/message.rb b/core/plugin/twitter/model/message.rb index ae4e71e2..1ae82eb3 100644 --- a/core/plugin/twitter/model/message.rb +++ b/core/plugin/twitter/model/message.rb @@ -116,7 +116,7 @@ class Plugin::Twitter::Message < Diva::Model service = Service.primary if retweetable? and service service.retweet(self){|*a| yield(*a) if block_given? } end end - deprecate :retweet, "spell (see: https://reference.mikutter.hachune.net/reference/2017/11/28/spell.html#retweet-twitter-tweet)", 2018, 11 + deprecate :retweet, "spell (see: https://reference.mikutter.hachune.net/reference/2017/11/28/spell.html#share-twitter-tweet)", 2018, 11 # この投稿を削除する def destroy @@ -604,7 +604,7 @@ class Plugin::Twitter::Message < Diva::Model end retweeted_users.include?(world.user_obj) if world.class.slug == :twitter end - deprecate :retweeted?, "spell (see: https://reference.mikutter.hachune.net/reference/2017/11/28/spell.html#retweeted-twitter-tweet)", 2018, 11 + deprecate :retweeted?, "spell (see: https://reference.mikutter.hachune.net/reference/2017/11/28/spell.html#shared-twitter-tweet)", 2018, 11 # この投稿を「自分」がリツイートしていれば真 def retweeted_by_me?(world = Enumerator.new{|y| Plugin.filtering(:worlds, y) }) @@ -616,7 +616,7 @@ class Plugin::Twitter::Message < Diva::Model retweeted_users.any?(&our.method(:include?)) end end - deprecate :retweeted_by_me?, "spell (see: https://reference.mikutter.hachune.net/reference/2017/11/28/spell.html#retweeted-twitter-tweet)", 2018, 11 + deprecate :retweeted_by_me?, "spell (see: https://reference.mikutter.hachune.net/reference/2017/11/28/spell.html#shared-twitter-tweet)", 2018, 11 # この投稿をリツイート等して、 _me_ のタイムラインに出現させたリツイートを返す。 # 特に誰もリツイートしていない場合は _self_ を返す。 diff --git a/core/plugin/twitter/twitter.rb b/core/plugin/twitter/twitter.rb index a3238980..d83ab01f 100644 --- a/core/plugin/twitter/twitter.rb +++ b/core/plugin/twitter/twitter.rb @@ -98,10 +98,10 @@ Plugin.create(:twitter) do } end - defspell(:destroy_retweet, :twitter, :twitter_tweet, - condition: ->(twitter, tweet){ retweeted?(twitter, tweet) } + defspell(:destroy_share, :twitter, :twitter_tweet, + condition: ->(twitter, tweet){ shared?(twitter, tweet) } ) do |twitter, tweet| - retweeted(twitter, tweet).next{ |retweet| + shared(twitter, tweet).next{ |retweet| destroy(twitter, retweet) } end @@ -179,7 +179,7 @@ Plugin.create(:twitter) do end end - defspell(:retweet, :twitter, :twitter_tweet, + defspell(:share, :twitter, :twitter_tweet, condition: ->(twitter, tweet){ !tweet.protected? } ) do |twitter, tweet| twitter.retweet(id: tweet.id).next{|retweeted| @@ -189,7 +189,7 @@ Plugin.create(:twitter) do } end - defspell(:retweeted, :twitter, :twitter_tweet, + defspell(:shared, :twitter, :twitter_tweet, condition: ->(twitter, tweet){ tweet.retweeted_users.include?(twitter.user_obj) } ) do |twitter, tweet| Delayer::Deferred.new.next{ |