Skip to main content

Name

msys.delivery.ob_get_current_message — Get the current message from the session context

Synopsis

msys.delivery.ob_get_current_message(sess.connh);

sess.connh: userdata, session context type

Description

Get the current message from the session context.

require("msys.delivery");

local mod = {};
function mod:generic_delivery_http_response_eval(sess)
  -- get the message
  local msg = msys.delivery.ob_get_current_message(sess.connh)
  -- check protocol
  if(msg:get_delivery_method() == "gcm") then
    -- do something with a GCM message
    ...
  else 
    -- not our protocol get out
    return msys.delivery.DELIVERY_CONTINUE
  end  
end

msys.registerModule("http_delivery", mod);

Enable this function with the statement require('msys.delivery');.

See Also

Was this page helpful?