All predicatesShow sourcenotify.pl -- SWISH notifications

This module keeps track of which users wish to track which notifications and sending the notifications to the user. If the target user is online we will notify using an avatar. Otherwise we send an email.

A user has the following options to control notifications:

Source redis_docid_key(+DocId, -Server, -Key) is semidet[private]
Source redis_queue_key(Server, -Key) is semidet[private]
Get the Redis server and key for specific requests. The Redis DB is organised as follows:
Prefix:notify:docid:Docid
A hash mapping profile ids onto a Prolog list of flags
Prefix:notify:queue
A list of Prolog terms holding queued pending email notifications.
Source queue_event(+Profile, +DocID, +Action) is det[private]
Source queue_event(+Profile, +DocID, +Action, +Status) is det[private]
Queue an email notification for Profile, described by Action. We simply append these events as Prolog terms to a file.
Arguments:
Status- is one of new or retry(Count,Status), where Count is the number of left attempts and Status is the last status.
Source send_queued_mails is det[private]
Send possible queued emails.
Source start_mail_scheduler[private]
Start a thread that schedules queued mail handling.
Source mail_main[private]
Infinite loop that schedules sending queued messages.
Source following(+DocID, ?ProfileID, ?Flags) is nondet[private]
Source follow(+DocID, +ProfileID, +Flags) is det
Assert that DocID is being followed by ProfileID using Flags.
Source notify(+DocID, +Action) is det
Action has been executed on DocID. Notify all interested users. Actions that may be notified:
updated(Commit)
Gitty file was updated
deleted(Commit)
Gitty file was deleted
forked(OldCommit, Commit)
Gitty file was forked
created(Commit)
A new gitty file was created
chat(Message)
A chat message was sent. Message is the JSON content as a dict. Message contains a docid key.
Source notify_user(+Profile, +DocID, +Action, +Options)[private]
Notify the user belonging to Profile about Action, which is related to document DocID.
Source event_generator(+Event, -ProfileID) is semidet[private]
True when ProfileID refers to the user that initiated Event.
Source notify_in_chat(+DocID, +Action)[private]
Source action_user(+Action, -User) is det[private]
Describe a user for chat purposes. Such a user is identified by the profile_id, name and/or avatar.
 message(+ProfileID, +DocID, +Action)//[private]
Source follow_file_options(+Request)[private]
Edit the file following options for the current user.
Source save_follow_file(+Request)[private]
Save the follow file options