Added indication of when replies are unthreaded.
This commit is contained in:
@@ -41,7 +41,8 @@ type BrMsgID struct {
|
|||||||
var flog *log.Entry
|
var flog *log.Entry
|
||||||
|
|
||||||
const (
|
const (
|
||||||
apiProtocol = "api"
|
apiProtocol = "api"
|
||||||
|
threadReplyPrefix = "thread reply"
|
||||||
)
|
)
|
||||||
|
|
||||||
func New(cfg config.Gateway, r *Router) *Gateway {
|
func New(cfg config.Gateway, r *Router) *Gateway {
|
||||||
@@ -288,6 +289,11 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM
|
|||||||
msg.Channel = originchannel
|
msg.Channel = originchannel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add prefix if reply message is being unthreaded.
|
||||||
|
if msg.ParentID != "" && canonicalParentMsgID == "" {
|
||||||
|
msg.Text = fmt.Sprintf("%s: %s", threadReplyPrefix, msg.Text)
|
||||||
|
}
|
||||||
|
|
||||||
msg.ParentID = gw.getDestMsgID(origmsg.Protocol+" "+canonicalParentMsgID, dest, channel)
|
msg.ParentID = gw.getDestMsgID(origmsg.Protocol+" "+canonicalParentMsgID, dest, channel)
|
||||||
if msg.ParentID == "" {
|
if msg.ParentID == "" {
|
||||||
msg.ParentID = canonicalParentMsgID
|
msg.ParentID = canonicalParentMsgID
|
||||||
|
|||||||
Reference in New Issue
Block a user