X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/73426ea3838a2f92f5b766b51e017d529c456471..aeb4271a27f3a331d65973f3c279cbc5bfa8a8dc:/app/models/message.rb diff --git a/app/models/message.rb b/app/models/message.rb index 49c11e900..7c12769d3 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -59,13 +59,10 @@ class Message < ApplicationRecord RichText.new(self[:body_format], self[:body]) end - def digest - md5 = Digest::MD5.new - md5 << from_user_id.to_s - md5 << to_user_id.to_s - md5 << sent_on.xmlschema - md5 << title - md5 << body - md5.hexdigest + def notification_token + sha256 = Digest::SHA256.new + sha256 << Rails.application.key_generator.generate_key("openstreetmap/message") + sha256 << id.to_s + Base64.urlsafe_encode64(sha256.digest)[0, 8] end end