diff options
author | Robin Jarry <robin@jarry.cc> | 2024-09-29 21:19:52 +0200 |
---|---|---|
committer | Tim Culverhouse <tim@timculverhouse.com> | 2024-10-03 12:07:00 -0500 |
commit | 1c54bb3a9d11185d86745c64f2c28655385c9146 (patch) | |
tree | ce752dd0d624647b0d69a11406ccf26b34ffb0c6 /models/models.go | |
parent | 09d283c9f70615d541b3603785c1db681389952f (diff) | |
download | aerc-1c54bb3a9d11185d86745c64f2c28655385c9146.tar.gz |
models: pad message uids with zeroes
IMAP message UIDs are 32 bits unsigned integers. All other backends use
opaque strings without any specific ordering. The UIDs are used for
ordering only for IMAP.
Pad the integer uids with zeroes when converting them to strings to
ensure ASCII sorting will work as previously.
Fixes: 73dc39c6ee08 ("treewide: replace uint32 uids with opaque strings")
Reported-by: Fedor Pchelkin <boddah8794@gmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Jens Grassel <jens@wegtam.com>
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/models.go b/models/models.go index 0f7c8445..4803c9b8 100644 --- a/models/models.go +++ b/models/models.go @@ -116,7 +116,7 @@ func UidToUint32(uid UID) uint32 { } func Uint32ToUid(u uint32) UID { - return UID(strconv.FormatUint(uint64(u), 10)) + return UID(fmt.Sprintf("%012d", u)) } func UidToUint32List(uids []UID) []uint32 { |