Adds support in the logger code that is unused for now.
Note that I9bf6f4bcd41d8da5 must be deployed before this can be used on
Wikimedia sites.
Bug: T120158
Change-Id: I1968f36e21139975d25231ac25c22a73dea6fd0d
The only difference at this point is that fetchByUser initializes
the EchoNotification object with $targetPages. It doesn't really
matter that it doesn't have the target pages, since fetchUnreadByUser
is currently only used in the flyout, where those target pages aren't
used. But regardless of what method was used to fetch the data, I
think the data should be the same.
And now, there's less code duplication...
Change-Id: I04c7b98794af5427a2217dd337108e7eea1e65c5
This adds "other" to the notificationGroup enum. This was already bumped
in wmf-config, but not in the extension itself.
Change-Id: If67754cfc40c004cebbf93d8b0e7d221d6620e61
Added code to redirect the user and display a short message informing
them of the need to login.
Bug: T118873
Change-Id: I2145bc1502dbd19d660302d9f19e0d4a2ad5ad50
Presentation models that display the number of bundled notifications
typically group these by a property like agent or page ID. For example,
every edit someone makes to a user talk page generates an event,
so there could be 5 edit-user-talk events by only 2 distinct users;
in that case we want to display "Foo and 1 other user left a message",
not "Foo and 4 other users".
With this change, a presentation model that wants such behavior
can pass a callback to getBundleCount() that retursn the user ID, which
will cause getBundleCount() to return the number of distinct
users rather than the total number of notifications.
Change-Id: I79c8dd14277eff0d2ec27f155b1d13dca1e571a8
I'm not really sure where to stick the primary link. I could wrap the
entire notification in a <a> tag, but all the text becomes ugly (I
suppose we could hack around it with CSS?). For now I just added it
before all the secondary links.
Change-Id: I4f6add9ecfb367660d1a6346825382ad415bdb77
The implementation of this sucks as the presentation model
should not be making database queries. But the API it provides
is what we want and will be supported even if the backend
implementation is changed.
Change-Id: Ifd0d11260990fd0e00e8f32eee273f9717d3e1fb
We should probably merge this ASAP now that a lot of presentation
models still have to be implemented. There's a bit of B/C code that
will take care of the previous format, but it would be nice to be
able to remove that soon.
Meanwhile I've also changed getPrimaryLink to follow the same format.
Bug: T115421
Change-Id: Ic18a050d2ee0239f287a6d55c572df6f8aebb59a
This implements a backend layer and database storage for tracking what
wikis a user has unread notifications on. It is not yet exposed via any
API.
Whenever the notification counts on the local wiki are reset, a deferred
update is queued to also update the central database table.
Change-Id: Id1498bdeb5811d6848dc66781ffca03e726eab90