[Plugin] Notifications system (1.0)

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
[Plugin] Re: Notifications system (1.0)
« Reply #150, on May 31st, 2013, 04:42 PM »
Quote from Arantor on May 31st, 2013, 04:34 PM
Yes, they're required to view notifications, however the notifications are pulled AJAXively, yes? In which case that would presume you only need to load it for the cases when a user is actually viewing them (i.e. as part of the AJAX service) rather than every page load.
Hm, that's a good point. It should be possible to load them on demand but I'll have to take a look at it. Since they don't really cause a lot of load it's not high on my priority atm.
The way it's meant to be

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
[Plugin] Re: Notifications system (1.0)
« Reply #153, on May 31st, 2013, 08:38 PM »
Yeah, essentially. I just don't quite see how to get from what SMF has to something unified with your notifications system.

I actually don't use what SMF has, so it's hard for me to understand how to make it work, as it were.

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
[Plugin] Re: Notifications system (1.0)
« Reply #154, on May 31st, 2013, 08:40 PM »
But I already have it working :P, at least I think I do. I'll give a detailed post tomorrow.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
[Plugin] Re: Notifications system (1.0)
« Reply #156, on June 2nd, 2013, 07:24 PM »
Got kind of late, ran into a terrible viral yesterday. Anyway, this is what I meant. It's not a new notifier but an extension to notifications itself, which facilitates providing notifications without any direct link but rather through an opt-in mode, hence the whole subscriptions thing. It works on similar principals of Notifications, a notifier which wants to be able to be subscribed has to declare a new class and specify it's behaviour, and call the subscription's publish options. Then the core pushes notifications (via the same notifier) to all the subscribed members. It doesn't really add much to the UI except a profile page to view notifications, most of it is internal stuff so that one can modularly add subscription features. Here's an example (topic subscriptions) which works just fine. I believe this is what you meant?

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
[Plugin] Re: Notifications system (1.0)
« Reply #157, on June 2nd, 2013, 07:31 PM »
I guess I need to install that to understand how it works... screenshots would have been nice :P

Nao

  • Dadman with a boy
  • Posts: 16,079
[Plugin] Re: Notifications system (1.0)
« Reply #158, on June 2nd, 2013, 07:49 PM »
Quote from Arantor on May 31st, 2013, 04:34 PM
Yes, they're required to view notifications, however the notifications are pulled AJAXively, yes? In which case that would presume you only need to load it for the cases when a user is actually viewing them (i.e. as part of the AJAX service) rather than every page load.
To his credit, IIRC I wrote the Ajaxification of the code, so before he released it to us, it had every reason to be loaded on every page.

Currently, only Ajax + the actual /do/notification page need initializing.
(Although I'm planning to redo the /do/ one, because it's... in need of some love, I guess.)

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
[Plugin] Re: Notifications system (1.0)
« Reply #161, on June 2nd, 2013, 10:05 PM »
Quote from Arantor on June 2nd, 2013, 08:38 PM
So we have two notifications pages then?
No, I'm not being clear I guess. The subscription plugin just adds the ability for existing notifier to have the ability to be subscribed to. The current page/UI is still used for preferences as well as for the notifications. Basically, it just adds a layer on top of the current system so that a plugin or core feature can add the ability to subscribe to any object (board, topic etc) which's notification is pushed through the current system. It adds no new UI element (the topic subscription one just replaces the URL of the current Notify button).

Basically here's how it goes (topic subscription plugin is an arbitrary example)
A user clicks "Notify" button on a topic -> the request gets sent to the subscription core which registers the ID and type of the subscription.
Another random user posts a reply -> the topic subscription plugin has a new_post callback which calls the subscription core to issue notifications
The subscription core issues notifications passing the given data to every subscribed member -> The topic subscription notifier kicks in and delivers all the notifications

You can install and try, or I can finish the patch in a couple of days (already WIP) and post it to merge.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
[Plugin] Re: Notifications system (1.0)
« Reply #162, on June 2nd, 2013, 10:07 PM »
Yeah, I figured about that much - but my concern is still there: how does the user see what they have subscribed to and optionally unsubscribe to those? That's what the old Profile > Notifications is for, giving you somewhere to review your subscriptions and to remove them - and right now we either have to figure out how to present the two separate notifications pages or fuse the list of things you're subscribed to into the notifications settings page...

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
[Plugin] Re: Notifications system (1.0)
« Reply #163, on June 2nd, 2013, 10:10 PM »
Quote from Arantor on June 2nd, 2013, 10:07 PM
Yeah, I figured about that much - but my concern is still there: how does the user see what they have subscribed to and optionally unsubscribe to those? That's what the old Profile > Notifications is for, giving you somewhere to review your subscriptions and to remove them - and right now we either have to figure out how to present the two separate notifications pages or fuse the list of things you're subscribed to into the notifications settings page...
Currently I'm adding a new page which lists all the current subscriptions (which works) subscriber wise. Considering this'll go in the core, we can do anything I guess. I can't do a screenshot since my localhost is messed up.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
[Plugin] Re: Notifications system (1.0)
« Reply #164, on June 2nd, 2013, 10:11 PM »
Why not just rewrite the current page that already covers existing subscriptions to boards/topics?