MCPcopy Create free account
hub / github.com/chanify/chanify / sendMsg

Method sendMsg

core/sender.go:151–162  ·  view source on GitHub ↗
(ctx sendContext, token *model.Token, msg *model.Message)

Source from the content-addressed store, hash-verified

149}
150
151func (c *Core) sendMsg(ctx sendContext, token *model.Token, msg *model.Message) {
152 u, err := c.logic.GetUser(token.GetUserID())
153 if err != nil {
154 ctx.JSON(http.StatusBadRequest, gin.H{"res": http.StatusBadRequest, "msg": "invalid user"})
155 return
156 }
157 if u.IsServerless() {
158 c.sendForward(ctx, token, msg)
159 return
160 }
161 c.sendDirect(ctx, token, msg)
162}
163
164func (c *Core) saveUploadImage(ctx *gin.Context, token *model.Token, data []byte) (*model.Message, error) {
165 if len(data) <= 0 {

Callers 4

handleSenderMethod · 0.95
handlePostSenderMethod · 0.95
luaContextSendFunction · 0.80
TestSendMsgFunction · 0.80

Calls 6

sendForwardMethod · 0.95
sendDirectMethod · 0.95
GetUserIDMethod · 0.80
IsServerlessMethod · 0.80
GetUserMethod · 0.65
JSONMethod · 0.65

Tested by 1

TestSendMsgFunction · 0.64