aboutsummaryrefslogtreecommitdiffstats
path: root/worker/types/messages.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2024-08-14 16:59:11 +0200
committerRobin Jarry <robin@jarry.cc>2024-08-28 12:06:01 +0200
commit73dc39c6ee0827fc68b93af8dc438b0e1c14e929 (patch)
treeaff067600ea6326ff179447ed968b6712013b889 /worker/types/messages.go
parent2950d919a5c5a55bd0eb53d6c41f989d8b70bd55 (diff)
downloadaerc-73dc39c6ee0827fc68b93af8dc438b0e1c14e929.tar.gz
treewide: replace uint32 uids with opaque strings
Add a new models.UID type (an alias to string). Replace all occurrences of uint32 being used as message UID or thread UID with models.UID. Update all workers to only expose models.UID values and deal with the conversion internally. Only IMAP needs to convert these to uint32. All other backends already use plain strings as message identifiers, in which case no conversion is even needed. The directory tree implementation needed to be heavily refactored in order to accommodate thread UID not being usable as a list index. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'worker/types/messages.go')
-rw-r--r--worker/types/messages.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/worker/types/messages.go b/worker/types/messages.go
index b91adbb7..0d0a187a 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -146,29 +146,29 @@ type RemoveDirectory struct {
type FetchMessageHeaders struct {
Message
Context context.Context
- Uids []uint32
+ Uids []models.UID
}
type FetchFullMessages struct {
Message
- Uids []uint32
+ Uids []models.UID
}
type FetchMessageBodyPart struct {
Message
- Uid uint32
+ Uid models.UID
Part []int
}
type FetchMessageFlags struct {
Message
Context context.Context
- Uids []uint32
+ Uids []models.UID
}
type DeleteMessages struct {
Message
- Uids []uint32
+ Uids []models.UID
MultiFileStrategy *MultiFileStrategy
}
@@ -177,32 +177,32 @@ type FlagMessages struct {
Message
Enable bool
Flags models.Flags
- Uids []uint32
+ Uids []models.UID
}
type AnsweredMessages struct {
Message
Answered bool
- Uids []uint32
+ Uids []models.UID
}
type ForwardedMessages struct {
Message
Forwarded bool
- Uids []uint32
+ Uids []models.UID
}
type CopyMessages struct {
Message
Destination string
- Uids []uint32
+ Uids []models.UID
MultiFileStrategy *MultiFileStrategy
}
type MoveMessages struct {
Message
Destination string
- Uids []uint32
+ Uids []models.UID
MultiFileStrategy *MultiFileStrategy
}
@@ -244,12 +244,12 @@ type DirectoryInfo struct {
type DirectoryContents struct {
Message
- Uids []uint32
+ Uids []models.UID
}
type SearchResults struct {
Message
- Uids []uint32
+ Uids []models.UID
}
type MessageInfo struct {
@@ -270,24 +270,24 @@ type MessageBodyPart struct {
type MessagesDeleted struct {
Message
- Uids []uint32
+ Uids []models.UID
}
type MessagesCopied struct {
Message
Destination string
- Uids []uint32
+ Uids []models.UID
}
type MessagesMoved struct {
Message
Destination string
- Uids []uint32
+ Uids []models.UID
}
type ModifyLabels struct {
Message
- Uids []uint32
+ Uids []models.UID
Add []string
Remove []string
}