From a9d8ac8bc0c745d43440aa56f1b602edf8e4aef7 Mon Sep 17 00:00:00 2001 From: Qais Patankar Date: Thu, 31 Dec 2020 18:01:57 +0000 Subject: Refactor "msg-parent-not-found" to config.ParentIDNotFound (#1347) --- bridge/config/config.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bridge/config') diff --git a/bridge/config/config.go b/bridge/config/config.go index 7dbbc80b..98935208 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -29,6 +29,8 @@ const ( EventNoticeIRC = "notice_irc" ) +const ParentIDNotFound = "msg-parent-not-found" + type Message struct { Text string `json:"text"` Channel string `json:"channel"` @@ -45,6 +47,14 @@ type Message struct { Extra map[string][]interface{} } +func (m Message) ParentNotFound() bool { + return m.ParentID == ParentIDNotFound +} + +func (m Message) ParentValid() bool { + return m.ParentID != "" && !m.ParentNotFound() +} + type FileInfo struct { Name string Data *[]byte -- cgit v1.2.3