Return false when we haven't subscribed to anything

This commit is contained in:
Garrett Thornburg 2017-09-01 21:16:41 -04:00
parent b93dd9968a
commit 63c977c815

View File

@ -259,6 +259,10 @@ func (p *PubSub) markSeen(id string) {
// subscribedToMessage returns whether we are subscribed to one of the topics
// of a given message
func (p *PubSub) subscribedToMsg(msg *pb.Message) bool {
if len(p.myTopics) == 0 {
return false
}
for _, t := range msg.GetTopicIDs() {
if _, ok := p.myTopics[t]; ok {
return true