Allow grouping for getBundleCount()
Allow grouping for getBundleCount()

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

wikimedia/mediawiki-extensions-Echo,wikimedia/mediawiki-extensions-Echo,wikimedia/mediawiki-extensions-Echo,wikimedia/mediawiki-extensions-Echo