Avoid showing panics directly if debug mode is not enabled

This commit is contained in:
Tulir Asokan
2018-03-19 01:18:36 +02:00
parent f288a18a0c
commit 7a4b108b37
4 changed files with 84 additions and 25 deletions

View File

@ -198,13 +198,13 @@ func (c *Container) HandleTyping(evt *gomatrix.Event) {
}
func (c *Container) SendMessage(roomID, message string) {
c.gmx.Recover()
defer c.gmx.Recover()
c.SendTyping(roomID, false)
c.client.SendText(roomID, message)
}
func (c *Container) SendTyping(roomID string, typing bool) {
c.gmx.Recover()
defer c.gmx.Recover()
ts := time.Now().Unix()
if c.typing > ts && typing {
return