Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -20,8 +21,11 @@ func init() {
|
|||||||
|
|
||||||
func cmdReply(cmd []string) {
|
func cmdReply(cmd []string) {
|
||||||
chat := k.NewChat(channel)
|
chat := k.NewChat(channel)
|
||||||
messageId, err := strconv.Atoi(cmd[1])
|
messageID, err := strconv.Atoi(cmd[1])
|
||||||
_, err = chat.Reply(messageId, strings.Join(cmd[2:], " "))
|
if err != nil {
|
||||||
|
printToView("Feed", fmt.Sprintf("There was an error determining message ID %s", cmd[1]))
|
||||||
|
}
|
||||||
|
_, err = chat.Reply(messageID, strings.Join(cmd[2:], " "))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
printToView("Feed", "There was an error with your reply.")
|
printToView("Feed", "There was an error with your reply.")
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
1
mage.go
1
mage.go
@ -79,7 +79,6 @@ func BuildEmoji() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
f.Sync()
|
f.Sync()
|
||||||
sh.Run("go", "fmt")
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
main.go
11
main.go
@ -365,19 +365,18 @@ func formatOutput(api keybase.ChatAPI) string {
|
|||||||
msg = colorRegex(msg, `(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*))`, messageLinkColor, messageBodyColor)
|
msg = colorRegex(msg, `(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*))`, messageLinkColor, messageBodyColor)
|
||||||
msg = colorText(colorReplaceMentionMe(msg, messageBodyColor), messageBodyColor, c)
|
msg = colorText(colorReplaceMentionMe(msg, messageBodyColor), messageBodyColor, c)
|
||||||
if msgType == "attachment" {
|
if msgType == "attachment" {
|
||||||
msg = fmt.Sprintf("%s\n%s", msg, colorText("[Attachment]", messageAttachmentColor, c))
|
msg = fmt.Sprintf("%s", colorText("[Attachment]", messageAttachmentColor, c))
|
||||||
}
|
}
|
||||||
|
|
||||||
user := colorUsername(api.Msg.Sender.Username, c)
|
user := colorUsername(api.Msg.Sender.Username, c)
|
||||||
device := colorText(api.Msg.Sender.DeviceName, messageSenderDeviceColor, c)
|
device := colorText(api.Msg.Sender.DeviceName, messageSenderDeviceColor, c)
|
||||||
msgId := colorText(fmt.Sprintf("%d", api.Msg.ID), messageIdColor, c)
|
msgID := colorText(fmt.Sprintf("%d", api.Msg.ID), messageIdColor, c)
|
||||||
ts := colorText(fmt.Sprintf("%s", tm.Format(timeFormat)), messageTimeColor, c)
|
ts := colorText(tm.Format(timeFormat), messageTimeColor, c)
|
||||||
ret = strings.Replace(ret, "$MSG", msg, 1)
|
ret = strings.Replace(ret, "$MSG", msg, 1)
|
||||||
ret = strings.Replace(ret, "$USER", user, 1)
|
ret = strings.Replace(ret, "$USER", user, 1)
|
||||||
ret = strings.Replace(ret, "$DEVICE", device, 1)
|
ret = strings.Replace(ret, "$DEVICE", device, 1)
|
||||||
ret = strings.Replace(ret, "$ID", msgId, 1)
|
ret = strings.Replace(ret, "$ID", msgID, 1)
|
||||||
ret = strings.Replace(ret, "$TIME", ts, 1)
|
ret = strings.Replace(ret, "$TIME", ts, 1)
|
||||||
ret = strings.Replace(ret, "$DATE", fmt.Sprintf("%s", tm.Format(dateFormat)), 1)
|
ret = strings.Replace(ret, "$DATE", colorText(tm.Format(dateFormat), messageTimeColor, c), 1)
|
||||||
ret = strings.Replace(ret, "```", fmt.Sprintf("\n<code>\n"), -1)
|
ret = strings.Replace(ret, "```", fmt.Sprintf("\n<code>\n"), -1)
|
||||||
}
|
}
|
||||||
return ret
|
return ret
|
||||||
|
|||||||
Reference in New Issue
Block a user