protocol/messenger_chats.go
Messenger
has 24 methods (exceeds 21 allowed). Consider refactoring. Open
Open
func (m *Messenger) getOneToOneAndNextClock(contact *Contact) (*Chat, uint64, error) {
chat, ok := m.allChats.Load(contact.ID)
if !ok {
publicKey, err := contact.PublicKey()
if err != nil {
Avoid deeply nested control flow statements. Open
Open
if strings.Contains(chatPreview.Text, "0x") {
//if there is a mention, we would like to send parsed text as well
chatPreview.ParsedText = chat.LastMessage.ParsedText
}
Avoid deeply nested control flow statements. Open
Open
if len(simplifiedText) > 100 {
chatPreview.Text = simplifiedText[:100]
} else {
chatPreview.Text = simplifiedText
}