liquid_feedback_frontend

diff app/main/member/_action/update_notify_level.lua @ 1255:1d645a8d20fc

Updates to notification system user config
author bsw
date Sun Apr 17 16:47:05 2016 +0200 (2016-04-17)
parents 84f6e17c7ceb
children 4afeb80741ad
line diff
     1.1 --- a/app/main/member/_action/update_notify_level.lua	Sun Apr 17 16:14:21 2016 +0200
     1.2 +++ b/app/main/member/_action/update_notify_level.lua	Sun Apr 17 16:47:05 2016 +0200
     1.3 @@ -1,3 +1,21 @@
     1.4 -app.session.member.disable_notifications = param.get("disable_notifications") == "true" and true or false
     1.5 -IgnoredArea:destroy_by_member_id(app.session.member_id)
     1.6 +local disable_notifications = param.get("disable_notifications") == "true" and true or false
     1.7 +
     1.8 +if app.session.member.disable_notifications ~= disable_notifications then
     1.9 +  IgnoredArea:destroy_by_member_id(app.session.member_id)
    1.10 +  app.session.member.disable_notifications = disable_notifications
    1.11 +end
    1.12 +
    1.13 +if param.get("digest", atom.boolean) the
    1.14 +  local dow = param.get("digest_dow")
    1.15 +  if dow == "daily" then
    1.16 +    app.session.member.digest_dow = nil
    1.17 +  else
    1.18 +    app.session.member.digest_dow = tonumber(dow)
    1.19 +  end
    1.20 +  app.session.member.digest_hour = param.get("digest_hour", atom.number)
    1.21 +else
    1.22 +  app.session.member.digest_dow = nil
    1.23 +  app.session.member.digest_hour = nil
    1.24 +end
    1.25 +
    1.26  app.session.member:save()

Impressum / About Us