Commit Graph

28 Commits

Author SHA1 Message Date
e5532d9618 Roughly implement change password/email, delete account modals 2015-05-26 18:03:02 +09:30
f54acebaf0 Fix bad logic in edit permission that was allowing guests to edit posts. Closes #88 2015-05-21 15:53:59 +09:30
edc59f37e3 PSR-2: Remove empty lines 2015-05-20 12:33:26 +09:30
3c7078b423 New user activity feed API.
Originally the user activity feed was implemented using UNIONs. I was
looking at make an API to add activity “sources”, or extra UNION
queries (select from posts, mentions, etc.) but quickly realised that
this is too slow and there’s no way to make it scale.

So I’ve implemented an API which is very similar to how notifications
work (see previous commit). The `activity` table is an aggregation of
stuff that happens, and it’s kept in sync by an ActivitySyncer which is
used whenever a post it created/edited/deleted, a user is
mentioned/unmentioned, etc.

Again, the API is very simple (see Core\Activity\PostedActivity +
Core\Handlers\Events\UserActivitySyncer)
2015-05-20 12:30:27 +09:30
98b3d0f89e Simplify and improve notifications API.
It turns out that the idea of “sending” a notification is flawed. (What
happens if the notification subject is deleted shortly after? The
notified user would end up with a dud notification which would be
confusing. What about if a post is edited to mention an extra user? If
you sent out notifications, the users who’ve already been mentioned
would get a duplicate notification.)

Instead, I’ve introduced the idea of notification “syncing”. Whenever a
change is made to a piece of data (e.g. a post is created, edited, or
deleted), you make a common notification and “sync” it to a set of
users. The users who’ve received this notification before won’t get it
again. It will be sent out to new users, and hidden from users who’ve
received it before but are no longer recipients (e.g. users who’ve been
“unmentioned” in a post).

To keep track of this, we use the existing notifications database
table, with an added `is_deleted` column. The syncing/diffing is
handled all behind the scenes; the API is extremely simple (see
Core\Notifications\DiscussionRenamedNotification +
Core\Events\Handlers\DiscussionRenamedNotifier)
2015-05-20 12:24:01 +09:30
811df6c278 Fix errors in DeleteAvatarAction/Command 2015-05-19 09:27:04 +09:30
dd54803aaf Fix remaining PSR-2 issues. 2015-05-19 01:07:22 +02:00
7885c9a002 Fix coding standards to conform to PSR-2 2015-05-19 01:03:12 +02:00
a577910d04 New object-based extension APIs 2015-05-17 10:19:54 +09:30
b4e5f0e6e5 Simplify permissions and add API to register configurable ones
Lots of thought has gone into this; it will show up later when I do the
admin permissions interface / category permissions :)
2015-05-15 17:05:46 +09:30
b4fd662000 Remove BasicFormatter; add LinkifyFormatter 2015-05-11 12:11:19 +09:30
f2056c4acf Clean up post type API 2015-05-05 14:28:40 +09:30
3726c97d5c Remove old code 2015-05-05 09:17:00 +09:30
d966c9831a Add event for registering user search gambits 2015-05-03 12:06:01 +09:30
60e69ae7b9 Add an event to register discussion gambits 2015-05-02 08:12:30 +09:30
3886efffef Turns out putting a . there breaks Laravel 2015-03-29 22:27:37 +10:30
40a6d77e74 Big front-end asset/filestructure refactor
- Extract shared Ember components into a “flarum-common” ember-cli
addon. This can be used by both the forum + admin Ember apps, keeping
things DRY
- Move LESS styles into their own top-level directory and do a similar
thing (extract common styles)
- Add LESS/JS compilation and versioning to PHP (AssetManager)
- Set up admin entry point

(Theoretical) upgrade instructions:
- Delete everything in [app_root]/public
- Set up tooling in forum/admin Ember apps (npm install/update, bower
install/update) and then build them (ember build)
- php artisan vendor:publish
- Upgrade flarum/flarum repo (slight change in a config file)
- If you need to trigger a LESS/JS recompile, delete the .css/.js files
in [app_root]/public/flarum. I set up LiveReload to do this for me when
I change files in less/ or ember/

Todo:
- Start writing admin app!
- Remove bootstrap/font-awesome from repo and instead depend on their
composer packages? Maybe? (Bower is not an option here)
2015-03-29 22:13:26 +10:30
bc9be30a02 More powerful/extensible notifications
- Notifications can be delivered in multiple ways (alert, email)
- Different notification types can implement interfaces to allow
themselves to be delivered in these various ways
- User preferences for each notification type/method combination are
automatically registered
2015-03-28 15:43:58 +10:30
49c3fa09e6 Change "renamed" post type to more descriptive "discussionRenamed" 2015-03-28 15:43:58 +10:30
359f44552e Implement user preferences API
Preferences must be registered (optionally with a callback to transform
data, and a default value) on the User model.
2015-03-28 15:43:57 +10:30
18ccec4190 Pass newly configured filesystem disk to upload handler. 2015-03-26 22:01:58 +01:00
e4ed057557 Wire up instantiation of Flysystem adapter for avatar storage. 2015-03-25 14:26:38 +01:00
4a1550215c Implement notifications 2015-03-24 15:07:38 +10:30
3880ce70f0 Add user activity system 2015-03-17 17:06:12 +10:30
4804d95b37 Implement user "bio" field
Perhaps this should be an extension, but it is pretty essential and I
can’t think of many instances where it wouldn’t be wanted. Would be
very easy to extract later on if need be.
2015-03-12 10:38:18 +10:30
6ffba13205 Implement user searching & minor search refactor 2015-03-12 10:37:02 +10:30
9ea482254c Finish signup process, including state restoration 2015-02-25 15:34:02 +10:30
2c46888db5 Upgrade to L5 + huge refactor + more. closes #2
New stuff:
- Signup + email confirmation.
- Updated authentication strategy with remember cookies. closes #5
- New search system with some example gambits! This is cool - check out
the source. Fulltext drivers will be implemented as decorators
overriding the EloquentPostRepository’s findByContent method.
- Lay down the foundation for bootstrapping the Ember app.
- Update Web layer’s asset manager to properly publish CSS/JS files.
- Console commands to run installation migrations and seeds.

Refactoring:
- New structure: move models, repositories, commands, and events into
their own namespaces, rather than grouping by entity.
- All events are classes.
- Use L5 middleware and command bus implementations.
- Clearer use of repositories and the Active Record pattern.
Repositories are used only for retrieval of ActiveRecord objects, and
then save/delete operations are called directly on those ActiveRecords.
This way, we don’t over-abstract at the cost of Eloquent magic, but
testing is still easy.
- Refactor of Web layer so that it uses the Actions routing
architecture.
- “Actor” concept instead of depending on Laravel’s Auth.
- General cleanup!
2015-02-24 20:33:18 +10:30