bump_server/lib/bump/messages.ex
raphael d2fe15d3ae adds message title, adds sender delete
- message now contains a second string
  which is meant for unencrypted title
  information, which can be displayed
  without e2e encryption.
- senders can now be deleted
- the same sender / token connection is
  no longer added to the database
2022-01-03 13:07:33 +01:00

32 lines
568 B
Elixir

defmodule Bump.Messages do
alias Bump.Database
alias Bump.Firebase
def pop(sender) do
Database.pop(sender)
end
def peek(sender) do
Database.peek(sender)
end
def list(sender, minutes) do
Database.list(sender, minutes)
end
def clear(sender) do
Database.clear(sender)
end
def push(sender, title, data) do
Database.push(sender, title, data)
tokens = Database.tokens(sender)
for token <- tokens do
Firebase.push(%{"firebase_token" => token.firebase_token, "title" => title, "data" => data})
end
end
end