diff options
author | Toshiaki Asai <toshi.alternative@gmail.com> | 2016-10-05 08:20:58 +0900 |
---|---|---|
committer | Toshiaki Asai <toshi.alternative@gmail.com> | 2016-10-05 08:28:29 +0900 |
commit | 8e67ab4a8aeb93198f0aa9949c9710c9c24c2c60 (patch) | |
tree | b95c7cd5a5ce3da591d201278de70709538801d9 /core/plugin/intent/model | |
parent | ce7aecc1532fff1cdbe61937a5c7538d6c493a6c (diff) | |
download | mikutter-8e67ab4a8aeb93198f0aa9949c9710c9c24c2c60.tar.gz |
openイベントにURIを渡した時、URIからModelを取得する refs #866
Diffstat (limited to 'core/plugin/intent/model')
-rw-r--r-- | core/plugin/intent/model/intent_token.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/plugin/intent/model/intent_token.rb b/core/plugin/intent/model/intent_token.rb index e2c6b5f8..2279c0ce 100644 --- a/core/plugin/intent/model/intent_token.rb +++ b/core/plugin/intent/model/intent_token.rb @@ -13,7 +13,16 @@ module Plugin::Intent # 設定された情報を使ってURI又はModelを開く def open - Plugin.call(:open, self) + if model? + Plugin.call(:open, self) + else + Deferred.new{ + Retriever.Model(intent.model_slug).find_by_uri(uri) + }.next{|m| + self.model = m + Plugin.call(:open, self) + }.terminate('なんか開けなかった') + end self end end |