Unverified Commit 0347170b authored by fk's avatar fk
Browse files

disable logging and also filter complete message structure

parent cc8a3996
......@@ -133,6 +133,17 @@ func (p *Plugin) FilterPost(post *model.Post) (*model.Post, string) {
}
}
match, error := regexp.MatchString("^( *:[^:]+: *)+$", post.Message)
if error != nil {
p.API.LogError("Error while matching regex")
return nil, "Error while matching regex"
}
if !match {
return nil, "Does not match required format"
}
splitMessage := strings.Split(post.Message, ":")
for _, name := range splitMessage {
......@@ -144,7 +155,7 @@ func (p *Plugin) FilterPost(post *model.Post) (*model.Post, string) {
// match is not empty or just spaces
if !match {
p.API.LogInfo(name)
//p.API.LogInfo(name)
// Check if the name is a system emoji
_, found := SystemEmojis[name]
......@@ -153,7 +164,7 @@ func (p *Plugin) FilterPost(post *model.Post) (*model.Post, string) {
_, err := p.API.GetEmojiByName(name)
if err != nil {
p.API.LogError(err.Message + " details: " + err.DetailedError)
//p.API.LogError(err.Message + " details: " + err.DetailedError)
//p.API.SendEphemeralPost(post.UserId, &model.Post{
// ChannelId: post.ChannelId,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment