diff --git a/utils/contacts.go b/utils/contacts.go index 13e721c..c93ff22 100644 --- a/utils/contacts.go +++ b/utils/contacts.go @@ -7,4 +7,6 @@ type Contact struct { Picture string `json:"picture"` Authorization string `json:"authorization"` SaveHistory string `json:"saveConversationHistory"` + Messages int `json:"numMessages"` + Unread int `json:"numUnread"` } diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 0f9b70d..997d64b 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -111,7 +111,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { if !set { saveHistory = event.DeleteHistoryDefault } - contacts = append(contacts, Contact{Name: name, Onion: contactInfo.Onion, Status: contactInfo.State, Picture: cpicPath, Authorization: string(contactInfo.Authorization), SaveHistory: saveHistory}) + contacts = append(contacts, Contact{Name: name, Onion: contactInfo.Onion, Status: contactInfo.State, Picture: cpicPath, Authorization: string(contactInfo.Authorization), SaveHistory: saveHistory, Messages: contactInfo.Timeline.Len(), Unread: 0,}) } bytes, _ := json.Marshal(contacts)