Package io.meeds.chat.plugin
Class ChatApplicationBadgePlugin
java.lang.Object
io.meeds.chat.plugin.ChatApplicationBadgePlugin
- All Implemented Interfaces:
io.meeds.appcenter.plugin.ApplicationBadgePlugin
@Component
@ConditionalOnClass(io.meeds.appcenter.plugin.ApplicationBadgePlugin.class)
public class ChatApplicationBadgePlugin
extends Object
implements io.meeds.appcenter.plugin.ApplicationBadgePlugin
Declares the chat badge and binds it to the Chat application, without
computing it.
Chat is the one contributor whose counter is authoritative in the browser: the Matrix client maintains it from its own sync state, and the topbar chat button renders it directly. Two consequences:
- There is no cheap server-side count to expose.
MatrixService.getUnreadConversationsdoes exist but performs acallAsUser, a conversation-title resolution and a full Matrix/syncper call — built for an on-demand MCP tool, not for a counter rendered on the topbar of every page. - Even if it were cheap, it would be a second source for a number already displayed next to it, and the two could disagree.
AppCenterAppBadge
rendering extension, reusing the very count the chat button shows, and this
plugin only carries the two things the frontend cannot know: the badge
identifier and which catalog entry it belongs to.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcountBadge(String username) Always 0: the real count is rendered by the frontend extension.getName()voidinit()booleanNothing is cached: there is no server-side value to cache.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.meeds.appcenter.plugin.ApplicationBadgePlugin
getDeclaredUrls, getDeclaredUrls, getPortletNames, isEnabled
-
Field Details
-
BADGE_NAME
- See Also:
-
-
Constructor Details
-
ChatApplicationBadgePlugin
public ChatApplicationBadgePlugin()
-
-
Method Details
-
init
@PostConstruct public void init() -
getName
- Specified by:
getNamein interfaceio.meeds.appcenter.plugin.ApplicationBadgePlugin
-
getDrawerNames
- Specified by:
getDrawerNamesin interfaceio.meeds.appcenter.plugin.ApplicationBadgePlugin
-
isSelfCached
public boolean isSelfCached()Nothing is cached: there is no server-side value to cache. Declaring this self-cached keeps App Center from storing — and later serving — the placeholder returned bycountBadge(String).- Specified by:
isSelfCachedin interfaceio.meeds.appcenter.plugin.ApplicationBadgePlugin
-
countBadge
Always 0: the real count is rendered by the frontend extension. The badge is still displayed, because a badge carrying a registered rendering extension owns its own visibility rather than depending on this value.- Specified by:
countBadgein interfaceio.meeds.appcenter.plugin.ApplicationBadgePlugin
-