mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-07-19 01:17:29 +02:00
Create auth API & comment code
This commit is contained in:
parent
1b15b12859
commit
c8d1c33cb4
17 changed files with 475 additions and 101 deletions
|
@ -158,19 +158,20 @@ func handleMessageEvent(matrixClient *mautrix.Client, startTs int64) mautrix.Eve
|
|||
}
|
||||
|
||||
if content.URL != "" {
|
||||
handleHashing(content, evt, matrixClient)
|
||||
|
||||
// This has an attachment!
|
||||
handleHashing(content, evt, matrixClient) // -> handleHashing.go
|
||||
return
|
||||
}
|
||||
|
||||
// No attachment, is this a command?
|
||||
if !strings.HasPrefix(content.Body, "!"+username) &&
|
||||
!strings.HasPrefix(content.Body, "@"+username) &&
|
||||
!(strings.HasPrefix(content.Body, username) && strings.HasPrefix(content.FormattedBody, "<a href=\"https://matrix.to/#/"+matrixClient.UserID.String()+"\">")) {
|
||||
return
|
||||
}
|
||||
|
||||
handleCommand(content.Body, evt.Sender, evt.RoomID, matrixClient)
|
||||
|
||||
// It is a command!
|
||||
handleCommand(content.Body, evt.Sender, evt.RoomID, matrixClient) // -> commandParser.go
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue