Changeset 652 in code for trunk/user.go
- Timestamp:
- Oct 18, 2021, 5:15:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/user.go
r644 r652 2 2 3 3 import ( 4 "context" 4 5 "crypto/sha256" 5 6 "encoding/binary" … … 331 332 } 332 333 333 if err := net.user.srv.db.DeleteChannel(c h.ID); err != nil {334 if err := net.user.srv.db.DeleteChannel(context.TODO(), ch.ID); err != nil { 334 335 return err 335 336 } … … 368 369 }) 369 370 370 if err := net.user.srv.db.StoreClientDeliveryReceipts( net.ID, clientName, receipts); err != nil {371 if err := net.user.srv.db.StoreClientDeliveryReceipts(context.TODO(), net.ID, clientName, receipts); err != nil { 371 372 net.logger.Printf("failed to store delivery receipts for client %q: %v", clientName, err) 372 373 } … … 488 489 }() 489 490 490 networks, err := u.srv.db.ListNetworks( u.ID)491 networks, err := u.srv.db.ListNetworks(context.TODO(), u.ID) 491 492 if err != nil { 492 493 u.logger.Printf("failed to list networks for user %q: %v", u.Username, err) … … 496 497 for _, record := range networks { 497 498 record := record 498 channels, err := u.srv.db.ListChannels( record.ID)499 channels, err := u.srv.db.ListChannels(context.TODO(), record.ID) 499 500 if err != nil { 500 501 u.logger.Printf("failed to list channels for user %q, network %q: %v", u.Username, record.GetName(), err) … … 506 507 507 508 if u.hasPersistentMsgStore() { 508 receipts, err := u.srv.db.ListDeliveryReceipts( record.ID)509 receipts, err := u.srv.db.ListDeliveryReceipts(context.TODO(), record.ID) 509 510 if err != nil { 510 511 u.logger.Printf("failed to load delivery receipts for user %q, network %q: %v", u.Username, network.GetName(), err) … … 591 592 } 592 593 uc.network.detach(c) 593 if err := uc.srv.db.StoreChannel( uc.network.ID, c); err != nil {594 if err := uc.srv.db.StoreChannel(context.TODO(), uc.network.ID, c); err != nil { 594 595 u.logger.Printf("failed to store updated detached channel %q: %v", c.Name, err) 595 596 } … … 780 781 781 782 network := newNetwork(u, record, nil) 782 err := u.srv.db.StoreNetwork( u.ID, &network.Network)783 err := u.srv.db.StoreNetwork(context.TODO(), u.ID, &network.Network) 783 784 if err != nil { 784 785 return nil, err … … 822 823 } 823 824 824 if err := u.srv.db.StoreNetwork( u.ID, record); err != nil {825 if err := u.srv.db.StoreNetwork(context.TODO(), u.ID, record); err != nil { 825 826 return nil, err 826 827 } … … 889 890 } 890 891 891 if err := u.srv.db.DeleteNetwork( network.ID); err != nil {892 if err := u.srv.db.DeleteNetwork(context.TODO(), network.ID); err != nil { 892 893 return err 893 894 } … … 915 916 916 917 realnameUpdated := u.Realname != record.Realname 917 if err := u.srv.db.StoreUser( record); err != nil {918 if err := u.srv.db.StoreUser(context.TODO(), record); err != nil { 918 919 return fmt.Errorf("failed to update user %q: %v", u.Username, err) 919 920 }
Note:
See TracChangeset
for help on using the changeset viewer.