access to hugeping echo

pull/1/head
Peter Kosyh 2021-02-05 09:40:10 +00:00
parent a66985c3b4
commit 18c45ac367
1 changed files with 5 additions and 0 deletions

View File

@ -718,6 +718,11 @@ func (db *DB) GetTopics(mi []*MsgInfo) map[string][]string {
// Store decoded message in database
// If message exists, returns error
func (db *DB) Store(m *Msg) error {
if r, _ := m.Tag("repto"); r == "" { // new one!
if m.Echo == "std.hugeping" && m.Addr != "ping,1" {
return errors.New("Access denied")
}
}
return db._Store(m, false)
}