aboutsummaryrefslogtreecommitdiffstats
path: root/core/plugin/intent/model
diff options
context:
space:
mode:
authorToshiaki Asai <toshi.alternative@gmail.com>2016-10-05 08:20:58 +0900
committerToshiaki Asai <toshi.alternative@gmail.com>2016-10-05 08:28:29 +0900
commit8e67ab4a8aeb93198f0aa9949c9710c9c24c2c60 (patch)
treeb95c7cd5a5ce3da591d201278de70709538801d9 /core/plugin/intent/model
parentce7aecc1532fff1cdbe61937a5c7538d6c493a6c (diff)
downloadmikutter-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.rb11
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