feat(chat): add endpoint to get quoted message by ID
Add GET /api/v1/messages/:id endpoint to retrieve quoted/replied messages for preview fill and navigation purposes. The endpoint includes authorization checks ensuring only conversation participants can access the message. Additionally improve file upload handling for native clients (expo-file-system) by accepting explicit displayName from frontend, with sanitization to prevent path traversal and 255-character length limit. File extension detection now prioritizes the real display name over the multipart header filename.
This commit is contained in:
@@ -407,6 +407,8 @@ func (r *Router) setupRoutes() {
|
||||
messages := v1.Group("/messages")
|
||||
messages.Use(authMiddleware)
|
||||
{
|
||||
// 按 ID 获取被引用消息(引用预览回填/跳转)
|
||||
messages.GET("/:id", r.MessageHandler.GetReplyMessage)
|
||||
// 撤回/删除消息(统一接口)
|
||||
messages.POST("/delete_msg", middleware.RequireVerified(r.UserService), r.MessageHandler.HandleDeleteMsg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user