From 73f1586518cc4d444b4887d5b12ce0a67144f8d3 Mon Sep 17 00:00:00 2001 From: Ashish <51633862+ashishjh-bst@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:36:45 +0530 Subject: [PATCH] Fix broken cc func openthread part2. (#1704) * Fixed bug in cc-func-openthread * fixed issue with tmplOpenThread, breaking change as it only accepts channelID --------- Co-authored-by: Ashish Jhanwar --- common/templates/context_funcs.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/common/templates/context_funcs.go b/common/templates/context_funcs.go index 20a41dabd1..b574f7ae45 100644 --- a/common/templates/context_funcs.go +++ b/common/templates/context_funcs.go @@ -1205,17 +1205,12 @@ func (c *Context) tmplEditThread(channel interface{}, args ...interface{}) (stri return "", nil } -func (c *Context) tmplOpenThread(channel interface{}) (string, error) { +func (c *Context) tmplOpenThread(cID int64) (string, error) { if c.IncreaseCheckCallCounter("edit_channel", 10) { return "", ErrTooManyCalls } - cID := c.ChannelArg(channel) - if cID == 0 { - return "", nil //dont send an error, a nil output would indicate invalid/unknown channel - } - if c.IncreaseCheckCallCounter("edit_channel_"+strconv.FormatInt(cID, 10), 2) { return "", ErrTooManyCalls }