Skip to content

Commit

Permalink
Fix broken cc func openthread part2. (#1704)
Browse files Browse the repository at this point in the history
* Fixed bug in cc-func-openthread

* fixed issue with tmplOpenThread, breaking change as it only accepts channelID

---------

Co-authored-by: Ashish Jhanwar <[email protected]>
  • Loading branch information
ashishjh-bst and ashishjh-bst authored Jul 16, 2024
1 parent 23a19ae commit 73f1586
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions common/templates/context_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 73f1586

Please sign in to comment.