Package io.meeds.chat.service
Class MatrixService
java.lang.Object
io.meeds.chat.service.MatrixService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMatrixService(MatrixRoomStorage matrixRoomStorage, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.storage.api.IdentityStorage identityStorage, org.exoplatform.services.organization.OrganizationService organizationService, MatrixHttpClient matrixHttpClient, org.exoplatform.services.cache.CacheService cacheService, org.exoplatform.commons.api.settings.SettingService settingService, io.meeds.social.space.template.service.SpaceTemplateService spaceTemplateService) -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the user able to access the roomvoidchangeChatRoomReadability(String roomId, boolean readOnly) Sets the room to readOnlycleanMatrixUsername(String userName) Cleans the username to be compatible with the usernames on Matrix servercreateDirectMessagingRoom(Room directMessagingRoom) Creates a one to one roomcreateRoom(org.exoplatform.social.core.space.model.Space space) This function do : - Create a room on Matrix - Links the room to the space on Meeds - Update room permissionscreateRoomForSpaceOnMatrix(org.exoplatform.social.core.space.model.Space space) Creates a room on Matrix for the spacevoiddeleteMedia(String mediaId) Deletes synapse media by its IDvoiddeleteRoom(String roomId) Delete a Matrix roomvoiddisableAccount(String matrixUsername) enableSpaceChat(org.exoplatform.social.core.space.model.Space space, boolean enable) Enable the chat for the spaceextractRoomId(String fullMatrixUserId) Extracts the room ID from the full room Id on MatrixextractUserId(String fullMatrixUserId) Extracts the user ID from the full User Id on Matrixorg.exoplatform.social.core.identity.model.IdentityfindSpaceMemberByMatrixId(String matrixId, org.exoplatform.social.core.space.model.Space space) Finds the identity of a user based on its Matrix ID and a space where he is a memberfindUserByMatrixId(String userMatrixId) find the user on Meeds based on his id on MatrixgetAccessToken(String jwtToken) Retrieves an access token for a user using a JWT tokenGet a room by its technical IDGet a room by its technical IDgetDirectMessagingRoom(String firstParticipant, String secondParticipant) getJWTSessionToken(String userNameOnMatrix) Returns the JWT for user authenticationgetMatrixDMRoomsOfUser(String user) Loads all the one to one rooms of a defined usergetMatrixIdForUser(String userName) Get the matrix ID of a defined usergetMediaInfo(String mediaId) Returns synapse media info by its IDString[]Returns the restricted group of users if it is configuredgetRoomBySpace(org.exoplatform.social.core.space.model.Space space) Returns the ID of the room linked to a spacegetRoomBySpace(org.exoplatform.social.core.space.model.Space space, boolean includeDisabled) Returns the ID of the room linked to a spacegetRoomBySpaceId(Long spaceId) Returns the ID of the room linked to a spacegetRoomBySpaceId(Long spaceId, boolean includeDisabled) Returns the ID of the room linked to a spacegetRoomEvent(String eventId, String roomId) Retrieves the message related to the event IDgetRoomEvent(String eventId, String roomId, String token) Retrieves the message related to the event IDgetRoomEventAsUser(String userName, String roomId, String eventId) Reads one event back with the user's own Matrix identity, so an event of a room the administrator account cannot see (a direct message) resolves too.getRoomMessages(String userName, String roomId, int limit) Returns the most recent messages of a conversation, in chronological order, read as the given user so that Synapse enforces exactly what that user is allowed to see (membership, history visibility, redactions).getRoomSettings(String roomId) Returns a list of all space roomsgetUnreadConversations(String userName) Returns the unread conversations of the given user, read as that user via a Matrix/sync, so only the rooms the user has joined are considered.getUserConversations(String userName) Lists the conversations the given user participates in: their direct messaging rooms and the rooms of the spaces they are a member of.getUserFullMatrixID(String userName) Convert the user id into the full Matrix ID formatvoidinit()Kicks off the connection to the Matrix server on a background thread so that the (possibly slow, possibly retried) handshake never blocks the WAR deployment / server startup.booleaninvalidateAccessToken(String accessToken) Invalidate a specific access tokenbooleanisChatAuthorizedByAdministration(org.exoplatform.social.core.space.model.Space space) Checks if the Chat is authorized from the administration for the spacebooleanisChatAuthorizedForSpace(Long spaceId) Check if Chat application is authorized for the space based on its templatebooleanisChatAuthorizedForSpace(org.exoplatform.social.core.space.model.Space space) Check if Chat application is authorized for the space based on its templatebooleanisChatAuthorizedForSpaceTemplate(org.exoplatform.social.core.space.model.Space space) Checks if the Chat is authorized for the template used to create the spacebooleanisChatEnabledByDefault(org.exoplatform.social.core.space.model.Space space) Check if the chat is enabled and synched be default for the provided spacebooleanChecks if the Chat feature is enabled and that the Matrix service is availablebooleanisUserMemberOfGroups(String userName, String... groups) Checks if the user is a member of a group defined by its namebooleanisUserMemberOfRoom(String roomId, String matrixIdOfUser) Checks if the user is a member of the roomvoidjoinUserToRoom(String roomId, String matrixIdOfUser) voidkickUserFromRoom(String roomId, String matrixIdOfUser, String message) linkSpaceToMatrixRoom(long spaceId, String roomId, RoomStatus roomStatus) records the matrix ID of the room linked to the spacelinkSpaceToMatrixRoom(org.exoplatform.social.core.space.model.Space space, String roomId) records the matrix ID of the room linked to the spaceretrieves the chat settingsloadChatSettings(String userName, Locale locale) retrieves the chat settingsvoidmakeUserAdminInRoom(String matrixRoomId, String matrixIdOfUser) booleanmarkRoomAsRead(String userName, String roomId, String eventId) Marks a room as read for a user up to an event, with the user's own Matrix identity (server-side read anchor): posts them.readreceipt so every client of the user converges through Matrix sync.voidoverrideAdminRateLimit(String adminUserId) Overrides the rate limits for the current administrator to unlimitedvoidrenameRoom(String roomId, String spaceDisplayName) voidsaveChatSettings(ChatSettings chatSettings) Sets the settings of the chat featuresaveUserAccount(org.exoplatform.social.core.identity.model.Identity user, boolean isNew) Saves a new user on MatrixsaveUserAccount(org.exoplatform.social.core.identity.model.Identity user, boolean isNew, boolean isEnableUserOperation, boolean isUserEnabled) Saves a new user on MatrixsearchChatMessages(String userName, String query, String conversationId, int limit) Runs a full-text search of message bodies as the given user, either across all their conversations (whenconversationIdis blank) or scoped to a single conversation.sendMessage(String userName, String roomId, String text) Sends a textual message to a conversation as the given user, after checking that the user participates in it.voidupdateRoomAvatar(org.exoplatform.social.core.space.model.Space space, String roomId) booleanupdateRoomDescription(String roomId, String description) booleanupdateRoomSettings(String roomId, MatrixRoomPermissions matrixRoomPermissions) voidupdateUserAvatar(org.exoplatform.social.core.identity.model.Profile profile, String userMatrixID) voidupdateUserDisplayName(String matrixFullID, String newDisplayName) updateUserPresence(String userIdOnMatrix, String presence, String statusMessage) update the user presence status on MatrixuploadFileOnMatrix(String fileName, String mimeType, byte[] fileBytes)
-
Field Details
-
CHAT_APPLICATION_ID
- See Also:
-
USER_MATRIX_ID_CACHE_NAME
- See Also:
-
defaultAuthorizedSpaceTemplates
-
USER_ACCESS_TOKEN_CACHE_NAME
- See Also:
-
-
Constructor Details
-
MatrixService
public MatrixService(MatrixRoomStorage matrixRoomStorage, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.storage.api.IdentityStorage identityStorage, org.exoplatform.services.organization.OrganizationService organizationService, MatrixHttpClient matrixHttpClient, org.exoplatform.services.cache.CacheService cacheService, org.exoplatform.commons.api.settings.SettingService settingService, io.meeds.social.space.template.service.SpaceTemplateService spaceTemplateService)
-
-
Method Details
-
init
@PostConstruct public void init()Kicks off the connection to the Matrix server on a background thread so that the (possibly slow, possibly retried) handshake never blocks the WAR deployment / server startup. SeeAsyncTaskUtils.runAsync(java.lang.String, java.lang.Runnable)for the escape hatch used by tests to run it synchronously instead. -
isServiceEnabled
public boolean isServiceEnabled()Checks if the Chat feature is enabled and that the Matrix service is available- Returns:
- the status fo the chat service and feature
-
getUserFullMatrixID
Convert the user id into the full Matrix ID format- Parameters:
userName- the username- Returns:
- formatted username
-
getAccessToken
public String getAccessToken(String jwtToken) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException Retrieves an access token for a user using a JWT token- Parameters:
jwtToken- the Json Web Token- Returns:
- String the access token
- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
invalidateAccessToken
Invalidate a specific access token- Parameters:
accessToken- the access token to be invalidated- Returns:
- true if success
-
updateUserDisplayName
-
getRoomBySpace
Returns the ID of the room linked to a space- Parameters:
space- the space- Returns:
- the roomId linked to the space
-
getRoomBySpace
public Room getRoomBySpace(org.exoplatform.social.core.space.model.Space space, boolean includeDisabled) Returns the ID of the room linked to a space- Parameters:
space- the space- Returns:
- the roomId linked to the space
-
getRoomBySpaceId
Returns the ID of the room linked to a space- Parameters:
spaceId- the space Id- Returns:
- the roomId linked to the space
-
getRoomBySpaceId
Returns the ID of the room linked to a space- Parameters:
spaceId- the space Id- Returns:
- the roomId linked to the space
-
getById
Get a room by its technical ID- Parameters:
roomId- the room technical ID- Returns:
- Room
-
getById
Get a room by its technical ID- Parameters:
roomId- the room technical IDincludeDisabled- return room even if it is disabled- Returns:
- Room
-
linkSpaceToMatrixRoom
public Room linkSpaceToMatrixRoom(org.exoplatform.social.core.space.model.Space space, String roomId) records the matrix ID of the room linked to the space- Parameters:
space- the SpaceroomId- the ID of the matrix room- Returns:
- the room ID
-
linkSpaceToMatrixRoom
records the matrix ID of the room linked to the space- Parameters:
spaceId- the Space identifierroomId- the ID of the matrix room- Returns:
- the room ID
-
createRoomForSpaceOnMatrix
public String createRoomForSpaceOnMatrix(org.exoplatform.social.core.space.model.Space space) throws Exception Creates a room on Matrix for the space- Parameters:
space- the space- Returns:
- String representing the room id
- Throws:
Exception- when creating the room fails on Matrix
-
getMatrixIdForUser
Get the matrix ID of a defined user- Parameters:
userName- of the user- Returns:
- the matrix ID
-
getJWTSessionToken
Returns the JWT for user authentication- Parameters:
userNameOnMatrix- the username of the current user- Returns:
- String
-
saveUserAccount
public String saveUserAccount(org.exoplatform.social.core.identity.model.Identity user, boolean isNew) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException Saves a new user on Matrix- Parameters:
user- the user identityisNew- if the user has been just created- Returns:
- the matrix user ID
- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
saveUserAccount
public String saveUserAccount(org.exoplatform.social.core.identity.model.Identity user, boolean isNew, boolean isEnableUserOperation, boolean isUserEnabled) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException Saves a new user on Matrix- Parameters:
user- the user to create on MatrixisNew- boolean if the user is new, then true- Returns:
- String the matrix user ID
- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
uploadFileOnMatrix
public String uploadFileOnMatrix(String fileName, String mimeType, byte[] fileBytes) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
updateUserAvatar
public void updateUserAvatar(org.exoplatform.social.core.identity.model.Profile profile, String userMatrixID) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
disableAccount
public void disableAccount(String matrixUsername) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
updateRoomDescription
public boolean updateRoomDescription(String roomId, String description) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
updateRoomAvatar
public void updateRoomAvatar(org.exoplatform.social.core.space.model.Space space, String roomId) throws Exception - Throws:
Exception
-
getRoomSettings
public MatrixRoomPermissions getRoomSettings(String roomId) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
updateRoomSettings
public boolean updateRoomSettings(String roomId, MatrixRoomPermissions matrixRoomPermissions) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
kickUserFromRoom
public void kickUserFromRoom(String roomId, String matrixIdOfUser, String message) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
joinUserToRoom
public void joinUserToRoom(String roomId, String matrixIdOfUser) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
isUserMemberOfRoom
public boolean isUserMemberOfRoom(String roomId, String matrixIdOfUser) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException Checks if the user is a member of the room- Parameters:
roomId- the room IDmatrixIdOfUser- the ID of the user on Matrix- Returns:
- true if the user is a member of the room, false otherwise
- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
renameRoom
public void renameRoom(String roomId, String spaceDisplayName) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
makeUserAdminInRoom
public void makeUserAdminInRoom(String matrixRoomId, String matrixIdOfUser) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException - Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
createRoom
This function do : - Create a room on Matrix - Links the room to the space on Meeds - Update room permissions- Parameters:
space- The space- Returns:
- The room ID
- Throws:
Exception
-
getDirectMessagingRoom
-
deleteRoom
public void deleteRoom(String roomId) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException Delete a Matrix room- Parameters:
roomId- the room identifier- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonExceptionIOExceptionInterruptedException
-
createDirectMessagingRoom
public Room createDirectMessagingRoom(Room directMessagingRoom) throws org.exoplatform.commons.ObjectAlreadyExistsException Creates a one to one room- Parameters:
directMessagingRoom- the Object representation of a one to one room- Returns:
- the created Room
- Throws:
org.exoplatform.commons.ObjectAlreadyExistsException- in case a room between the same users is already created
-
getMatrixDMRoomsOfUser
Loads all the one to one rooms of a defined user- Parameters:
user- the username of the user- Returns:
- List of Room
-
isUserMemberOfGroups
Checks if the user is a member of a group defined by its name- Parameters:
userName- the userNamegroups- the list of groups- Returns:
- true if the user is a member of the group
- Throws:
Exception- error finding the user
-
getSpaceRooms
Returns a list of all space rooms- Returns:
- List of Space rooms
-
extractUserId
Extracts the user ID from the full User Id on Matrix- Parameters:
fullMatrixUserId- the full Matrix user Id- Returns:
- the user Identifier
-
extractRoomId
Extracts the room ID from the full room Id on Matrix- Parameters:
fullMatrixUserId- the full Matrix user Id- Returns:
- the user Identifier
-
updateUserPresence
update the user presence status on Matrix- Parameters:
userIdOnMatrix- the user Id on Matrixpresence- the presence value: online , unavailable, offlinestatusMessage- a personalized status message
-
canAccess
Checks if the user able to access the room- Parameters:
room- the roomuserName- the username of the user- Returns:
- true if he has access, false otherwise
-
enableSpaceChat
public Room enableSpaceChat(org.exoplatform.social.core.space.model.Space space, boolean enable) throws org.exoplatform.commons.exception.ObjectNotFoundException Enable the chat for the space- Parameters:
space- the space where the chat will be disabled/enabledenable- true to enable the room, false to disable it- Returns:
- Room the updated room
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-
overrideAdminRateLimit
Overrides the rate limits for the current administrator to unlimited- Parameters:
adminUserId- the admin username on Matrix
-
getRoomEvent
Retrieves the message related to the event ID- Parameters:
eventId- the event IDroomId- the room ID- Returns:
- MatrixMessage the received message
-
getRoomEvent
Retrieves the message related to the event ID- Parameters:
eventId- the event IDroomId- the room ID- Returns:
- MatrixMessage the received message
-
findSpaceMemberByMatrixId
public org.exoplatform.social.core.identity.model.Identity findSpaceMemberByMatrixId(String matrixId, org.exoplatform.social.core.space.model.Space space) Finds the identity of a user based on its Matrix ID and a space where he is a member- Parameters:
matrixId- the Matrix identifier of the userspace- the space- Returns:
- the identity of the space member
-
findUserByMatrixId
find the user on Meeds based on his id on Matrix- Parameters:
userMatrixId- the ID of the user on Matrix- Returns:
- the user Identity
-
cleanMatrixUsername
Cleans the username to be compatible with the usernames on Matrix server- Parameters:
userName- the user identifier- Returns:
- String the cleaned username
-
getRestrictedGroups
Returns the restricted group of users if it is configured- Returns:
- Array of group names
-
getMediaInfo
public Optional<MediaInfo> getMediaInfo(String mediaId) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException Returns synapse media info by its ID- Parameters:
mediaId- synapse media id- Returns:
MediaInfowrapped inOptional, orOptional.empty()if mediaId is null or blank- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonException- if there is an error parsing the JSON response from the serverIOException- if a network or I/O error occurs during the requestInterruptedException- if the thread executing the request is interrupted
-
deleteMedia
public void deleteMedia(String mediaId) throws org.exoplatform.ws.frameworks.json.impl.JsonException, IOException, InterruptedException Deletes synapse media by its ID- Parameters:
mediaId- synapse media id- Throws:
IllegalArgumentException- if mediaId is null or blankorg.exoplatform.ws.frameworks.json.impl.JsonException- if there is an error parsing the JSON response from the serverIOException- if a network or I/O error occurs during the requestInterruptedException- if the thread executing the request is interrupted
-
loadChatSettings
retrieves the chat settings- Returns:
- the status of the chat feature
-
loadChatSettings
retrieves the chat settings- Parameters:
userName- the caller usernamelocale- the caller Locale- Returns:
- the Chat settings
-
saveChatSettings
Sets the settings of the chat feature- Parameters:
chatSettings- the new status fo the chat enabled/disabled
-
isChatAuthorizedForSpace
Check if Chat application is authorized for the space based on its template- Parameters:
spaceId- The space identifier- Returns:
- boolean : true if the chat is authorized
-
isChatAuthorizedForSpace
public boolean isChatAuthorizedForSpace(org.exoplatform.social.core.space.model.Space space) Check if Chat application is authorized for the space based on its template- Parameters:
space- The space- Returns:
- boolean : true if the chat is authorized
-
isChatAuthorizedForSpaceTemplate
public boolean isChatAuthorizedForSpaceTemplate(org.exoplatform.social.core.space.model.Space space) Checks if the Chat is authorized for the template used to create the space- Parameters:
space- The given space- Returns:
- True if the chat was authorized for this space template
-
isChatAuthorizedByAdministration
public boolean isChatAuthorizedByAdministration(org.exoplatform.social.core.space.model.Space space) Checks if the Chat is authorized from the administration for the space- Parameters:
space- The given space- Returns:
- True if the chat was authorized for this space
-
isChatEnabledByDefault
public boolean isChatEnabledByDefault(org.exoplatform.social.core.space.model.Space space) Check if the chat is enabled and synched be default for the provided space- Parameters:
space- the related space- Returns:
- boolean True if the chat is enabled by default
-
changeChatRoomReadability
Sets the room to readOnly- Parameters:
roomId- the room identifierreadOnly- true if the room will be set readonly
-
getUserConversations
Lists the conversations the given user participates in: their direct messaging rooms and the rooms of the spaces they are a member of. Used by thelist_chat_conversationsMCP tool to give AI agents the user's chat context.- Parameters:
userName- the Meeds username- Returns:
- the user's conversations, never
null
-
getRoomEventAsUser
Reads one event back with the user's own Matrix identity, so an event of a room the administrator account cannot see (a direct message) resolves too.- Parameters:
userName- the platform userroomId- the room (local or full id)eventId- the event to read back- Returns:
- the event, or null when it cannot be read
-
markRoomAsRead
Marks a room as read for a user up to an event, with the user's own Matrix identity (server-side read anchor): posts them.readreceipt so every client of the user converges through Matrix sync.- Parameters:
userName- the platform userroomId- the room (local or full id)eventId- the event read up to (high-water mark)- Returns:
- true when the receipt was posted
-
getRoomMessages
Returns the most recent messages of a conversation, in chronological order, read as the given user so that Synapse enforces exactly what that user is allowed to see (membership, history visibility, redactions). A cheap participant pre-check avoids reading conversations the user is obviously not part of. Used by theget_chat_messagesMCP tool.- Parameters:
userName- the Meeds username actingroomId- the Matrix room id of the conversationlimit- the maximum number of messages to return (clamped to [1, 200])- Returns:
- the conversation messages, oldest first, never
null
-
getUnreadConversations
Returns the unread conversations of the given user, read as that user via a Matrix/sync, so only the rooms the user has joined are considered. Each entry carries the unread count and the recent messages, with a human readable title resolved from the user's conversations. Used by theget_unread_chat_messagesMCP tool.- Parameters:
userName- the Meeds username acting- Returns:
- the user's unread conversations, never
null
-
sendMessage
Sends a textual message to a conversation as the given user, after checking that the user participates in it. Synapse additionally enforces that the user is allowed to post. Used by thesend_chat_messageMCP tool, e.g. to let an AI agent post a real-time reply on the user's behalf.- Parameters:
userName- the Meeds username actingroomId- the Matrix room id of the conversationtext- the plain text message to send- Returns:
- the created event id, or
nullwhen the message could not be sent
-
searchChatMessages
public List<ChatSearchResult> searchChatMessages(String userName, String query, String conversationId, int limit) Runs a full-text search of message bodies as the given user, either across all their conversations (whenconversationIdis blank) or scoped to a single conversation. Synapse enforces the user's Matrix visibility, and the hits are then restricted to the conversations that are tracked by the platform and accessible to the user — the same rooms the chat list shows and the row can open — so a room they still belong to on Matrix but not in the chat (created from another Matrix client, left behind by a failed space kick) is never returned. Each hit is resolved to a human readable conversation title. Backs thesearch_chat_messagesMCP tool and the chat UI search.- Parameters:
userName- the Meeds username actingquery- the free-text search termconversationId- the Matrix room id to scope the search to, ornull/blank to search across all the user's conversationslimit- the maximum number of hits to return (clamped to [1, 100])- Returns:
- the matching messages, most recent first, never
null
-