MCPcopy Create free account
hub / github.com/53AI/53AIHub / handlePlatformConversationID

Function handlePlatformConversationID

api/middleware/relay_auth.go:265–279  ·  view source on GitHub ↗
(c *gin.Context, eid int64, userID int64, conversationIDValue interface{})

Source from the content-addressed store, hash-verified

263}
264
265func handlePlatformConversationID(c *gin.Context, eid int64, userID int64, conversationIDValue interface{}) bool {
266 conversationID, ok := parsePlatformConversationID(conversationIDValue)
267 if !ok {
268 writeConversationNotFound(c)
269 return false
270 }
271 conversation, err := model.GetConversationByIdAndUserId(eid, conversationID, userID)
272 if err != nil {
273 writeConversationNotFound(c)
274 return false
275 }
276 c.Set(session.SESSION_CONVERSATION_ID, conversationID)
277 c.Set(session.SESSION_CONVERSATION, conversation)
278 return true
279}
280
281func parsePlatformConversationID(conversationIDValue interface{}) (int64, bool) {
282 switch v := conversationIDValue.(type) {

Callers 3

RelayTokenAuthFunction · 0.85

Calls 3

SetMethod · 0.80

Tested by

no test coverage detected