Private
Public Access
1
0

Kordophone-2.6: lastMessage in /conversations

This commit is contained in:
2023-08-10 00:42:21 -07:00
parent f13a809f1e
commit 56ad3a49ea
4 changed files with 8 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ func setupLogging() {
func printWelcomeMessage() {
// Print ascii art of "Kordophone"
fmt.Println(`
_ __ _ _
_ __ _ _
| |/ /___ _ _ __| |___ _ __| |_ ___ _ _ ___
| ' </ _ \ '_/ _' / _ \ '_ \ ' \/ _ \ ' \/ -_)
|_|\_\___/_| \__,_\___/ .__/_||_\___/_||_\___|

View File

@@ -13,6 +13,7 @@ type Conversation struct {
DisplayName *string `json:"displayName,omitempty"` // Optional
UnreadCount int `json:"unreadCount"`
LastMessagePreview string `json:"lastMessagePreview"`
LastMessage Message `json:"lastMessage"`
Guid string `json:"guid"`
}

View File

@@ -9,11 +9,11 @@ import (
type Message struct {
Text string `json:"text"`
Guid string `json:"guid"`
Sender *string `json:"sender"` // Optional: nil means from "me"
Sender *string `json:"sender,omitempty"` // Optional: nil means from "me"
Date time.Time `json:"date"`
// Map of attachment GUID to attachment metadata
Attachments *map[string]AttributionInfo `json:"attachmentMetadata"` // Optional
Attachments *map[string]AttributionInfo `json:"attachmentMetadata,omitempty"` // Optional
}
type AttributionInfo struct {

View File

@@ -9,7 +9,7 @@ import (
"github.com/rs/zerolog/log"
)
const VERSION = "Kordophone-2.0"
const VERSION = "Kordophone-2.6"
const (
AUTH_USERNAME = "test"
@@ -118,7 +118,8 @@ func (s *Server) PopulateWithTestData() {
}
}
// Update last message preview
// Update last message
convo.LastMessage = lastMessage
convo.LastMessagePreview = lastMessage.Text
}