3
0

Add a bit of protection for messages fetch

This commit is contained in:
Denis Arh
2018-10-25 16:55:14 +02:00
parent e36621f016
commit a5872e1655
+6
View File
@@ -81,6 +81,12 @@ func (r *message) FindMessages(filter *types.MessageFilter) (types.MessageSet, e
}
}
if filter.ChannelID == 0 && filter.RepliesTo == 0 {
// Channel history or replies to a message...
// nothing more.
return nil, nil
}
if filter.ChannelID > 0 {
sql += " AND rel_channel = ? "
params = append(params, filter.ChannelID)