vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb
#story sizes from the Facebooker API
story sizes from the Facebooker API
story sizes from the Facebooker API
def send_message(method)
        @recipients = @recipients.is_a?(Array) ? @recipients : [@recipients]
        if from.nil? and @recipients.size==1 and requires_from_user?(from,_body)
          @from = @recipients.first
        end
        raise InvalidSender.new("Sender must be a Facebooker::User") unless from.is_a?(Facebooker::User) || !requires_from_user?(from,_body)
        case _body
        when Facebooker::Feed::TemplatizedAction,Facebooker::Feed::Action
          from.publish_action(_body)
        when Facebooker::Feed::Story
          @recipients.each {|r| r.publish_story(_body)}
        when Notification
          (from.nil? ? Facebooker::Session.create : from.session).send_notification(@recipients,_body.fbml)
        when Email
          from.session.send_email(@recipients, 
                                             _body.title, 
                                             _body.text, 
                                             _body.fbml)
        when Profile
         @from = Facebooker::User.new(Facebooker::User.cast_to_facebook_id(@recipients.first),Facebooker::Session.create) 
         @from.set_profile_fbml(_body.profile, _body.mobile_profile, _body.profile_action, _body.profile_main)
        when Ref
          Facebooker::Session.create.server_cache.set_ref_handle(_body.handle,_body.fbml)
        when UserAction
          @from.session.publish_user_action(_body.template_id,_body.data_hash,_body.target_ids,_body.body_general,_body.story_size)
        when Facebooker::StreamPost
         @from.publish_to(_body.target, {:attachment => _body.attachment, :action_links => @action_links, :message => _body.message })
        else
          raise UnspecifiedBodyType.new("You must specify a valid send_as")
        end
      end
def send_message ( method ) @recipients = @recipients . is_a? ( Array ) ? @recipients : [ @recipients ] if from . nil? and @recipients . size == 1 and requires_from_user? ( from , _body ) @from = @recipients . first end raise InvalidSender . new ( "Sender must be a Facebooker::User" ) unless from . is_a? ( Facebooker :: User ) || ! requires_from_user? ( from , _body ) case _body when Facebooker :: Feed :: TemplatizedAction , Facebooker :: Feed :: Action from . publish_action ( _body ) when Facebooker :: Feed :: Story @recipients . each { | r | r . publish_story ( _body ) } when Notification ( from . nil? ? Facebooker :: Session . create : from . session ) . send_notification ( @recipients , _body . fbml ) when Email from . session . send_email ( @recipients , _body . title , _body . text , _body . fbml ) when Profile @from = Facebooker :: User . new ( Facebooker :: User . cast_to_facebook_id ( @recipients . first ) , Facebooker :: Session . create ) @from . set_profile_fbml ( _body . profile , _body . mobile_profile , _body . profile_action , _body . profile_main ) when Ref Facebooker :: Session . create . server_cache . set_ref_handle ( _body . handle , _body . fbml ) when UserAction @from . session . publish_user_action ( _body . template_id , _body . data_hash , _body . target_ids , _body . body_general , _body . story_size ) when Facebooker :: StreamPost @from . publish_to ( _body . target , { :attachment => _body . attachment , :action_links => @action_links , :message => _body . message } ) else raise UnspecifiedBodyType . new ( "You must specify a valid send_as" ) end end
story sizes from the Facebooker API
story sizes from the Facebooker API
# notifications can  # omit the from address # If recipient and from aren't the same person, create a new user object using the # userid from recipient and the session from from
method
<not_specific>