aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshiaki Asai <toshi.alternative@gmail.com>2017-12-22 06:45:04 +0900
committerToshiaki Asai <toshi.alternative@gmail.com>2017-12-22 06:45:04 +0900
commit5d41a27252c2884c9d2b633cb3557def26e4fc84 (patch)
treed153af888635dd51962992aae04f0f926372d590
parent0b09d08400899d85c35329084bca4beaaa39bb27 (diff)
downloadmikutter-5d41a27252c2884c9d2b633cb3557def26e4fc84.tar.gz
起動時にWorldの復元に失敗した場合、それを削除する refs #1125
-rw-r--r--core/plugin/world/model/zombie.rb8
-rw-r--r--core/plugin/world/world.rb8
2 files changed, 14 insertions, 2 deletions
diff --git a/core/plugin/world/model/zombie.rb b/core/plugin/world/model/zombie.rb
new file mode 100644
index 00000000..cebbb183
--- /dev/null
+++ b/core/plugin/world/model/zombie.rb
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+
+module Plugin::World
+ # 滅びた世界
+ class Zombie < Diva::Model
+ field.string :slug, required: true
+ end
+end
diff --git a/core/plugin/world/world.rb b/core/plugin/world/world.rb
index 584f8eaa..2f8b486c 100644
--- a/core/plugin/world/world.rb
+++ b/core/plugin/world/world.rb
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
require_relative 'error'
require_relative 'keep'
+require_relative 'model/zombie'
require_relative 'service'
miquire :core, 'environment', 'configloader', 'userconfig'
@@ -134,9 +135,12 @@ Plugin.create(:world) do
if provider
provider.new(serialized)
else
- raise "unknown model #{serialized[:provider].inspect}"
+ activity :error, _('アカウント「%{world}」のためのプラグインが読み込めなかったため、このアカウントの登録をmikutterから解除しました。') % {world: id},
+ description: _('アカウント「%{world}」に必要な%{plugin}プラグインが見つからなかったため、このアカウントの登録をmikutterから解除しました。') % {plugin: serialized[:provider], world: id}
+ Plugin.call(:world_destroy, Plugin::World::Zombie.new(slug: id))
+ nil
end
end
- }.freeze
+ }.compact.freeze
end
end