@@ -652,12 +652,12 @@ func (mysql *MySQL) insertCorrespondentsEntry(ctx context.Context, target, corre
652652}
653653
654654func (mysql * MySQL ) insertBase (ctx context.Context , item history.Item ) (id int64 , err error ) {
655- value , err := marshalItem (& item )
655+ value , err := history . MarshalItem (& item )
656656 if err != nil {
657657 return 0 , fmt .Errorf ("could not marshal item: %w" , err )
658658 }
659659
660- msgidBytes , err := decodeMsgid (item .Message .Msgid )
660+ msgidBytes , err := utils . DecodeSecretToken (item .Message .Msgid )
661661 if err != nil {
662662 return 0 , fmt .Errorf ("could not decode msgid: %w" , err )
663663 }
@@ -754,7 +754,7 @@ func (mysql *MySQL) DeleteMsgid(msgid, accountName string) (err error) {
754754
755755 if accountName != "*" {
756756 var item history.Item
757- err = unmarshalItem (data , & item )
757+ err = history . UnmarshalItem (data , & item )
758758 // delete if the entry is corrupt
759759 if err == nil && item .AccountName != accountName {
760760 return ErrDisallowed
@@ -800,7 +800,7 @@ func (mysql *MySQL) Export(account string, writer io.Writer) {
800800 if err != nil {
801801 return
802802 }
803- err = unmarshalItem (blob , & item )
803+ err = history . UnmarshalItem (blob , & item )
804804 if err != nil {
805805 return
806806 }
@@ -828,7 +828,7 @@ func (mysql *MySQL) Export(account string, writer io.Writer) {
828828}
829829
830830func (mysql * MySQL ) lookupMsgid (ctx context.Context , msgid string , includeData bool ) (result time.Time , id uint64 , data []byte , err error ) {
831- decoded , err := decodeMsgid (msgid )
831+ decoded , err := utils . DecodeSecretToken (msgid )
832832 if err != nil {
833833 return
834834 }
@@ -886,7 +886,7 @@ func (mysql *MySQL) selectItems(ctx context.Context, query string, args ...inter
886886 if err != nil {
887887 return nil , fmt .Errorf ("could not scan history item: %w" , err )
888888 }
889- err = unmarshalItem (blob , & item )
889+ err = history . UnmarshalItem (blob , & item )
890890 if err != nil {
891891 return nil , fmt .Errorf ("could not unmarshal history item: %w" , err )
892892 }
0 commit comments