Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRaphael Sofaer <raphael@joindiaspora.com>2011-07-22 03:30:00 +0400
committerRaphael Sofaer <raphael@joindiaspora.com>2011-07-22 03:30:00 +0400
commit20de3a5622934117406e45fe95799988909bd218 (patch)
tree3810501b00a44b019c5ca2d950d665e689a27dd6 /lib
parenta58a06a0105351802f078da3fcfac7a510a5367d (diff)
Refactor StatusMessagesController#create, move the photo dispatching into an after_dispatch hook
Diffstat (limited to 'lib')
-rw-r--r--lib/diaspora/webhooks.rb8
-rw-r--r--lib/postzord/dispatch.rb1
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/diaspora/webhooks.rb b/lib/diaspora/webhooks.rb
index a8fbf18f6..d342d8ef8 100644
--- a/lib/diaspora/webhooks.rb
+++ b/lib/diaspora/webhooks.rb
@@ -11,17 +11,23 @@ module Diaspora
xml += "<post>#{to_xml.to_s}</post>"
xml += "</XML>"
end
-
+
def x(input)
input.to_s.to_xs
end
+ # @abstract
def subscribers(user)
raise 'you must override subscribers in order to enable federation on this model'
end
+ # @abstract
def receive(user, person)
raise 'you must override receive in order to enable federation on this model'
end
+
+ # @param [User] sender
+ def after_dispatch sender
+ end
end
end
diff --git a/lib/postzord/dispatch.rb b/lib/postzord/dispatch.rb
index 1204e0e65..75ba6db1f 100644
--- a/lib/postzord/dispatch.rb
+++ b/lib/postzord/dispatch.rb
@@ -35,6 +35,7 @@ class Postzord::Dispatch
self.deliver_to_remote(remote_people)
end
self.deliver_to_services(opts[:url], opts[:services] || [])
+ @object.after_dispatch(@sender)
end
protected