RyffProject/ryff-api — pull request #46 by rfotino (2014-08-23 19:51:59+00:00)
Title: Feature/notifications, see #41

This adds a Notifications model. Right now there are 4 types of notification, "follow", "upvote", "mention", and "remix". These are added when someone follows you, upvotes your post, @-mentions you in a post, or remixes your riff, respectively. These notifications will stack if a compatible notification is found that was updated recently (how recent can be set in config.php). There are get-notifications and set-notification-read scripts. The get-notifications script returns an array of notifications and accepts pagination parameters. These notifications have id, type, is_read, date_read, date_updated, date_created, user, post, users, and posts properties, where date_read, user, post, users, and posts are optional. The user/post/users/posts properties are intuitive when paired with the type; for example, if the type is "follow", only the users property will be set, which is an array of users that have followed you. For "upvote", post and users are set. For "mention" and "remix", only posts is set. This should easily extend to other types of notifications.