From f59ca1976a1075e9e8fdf1e5fcdb7cfc853493b8 Mon Sep 17 00:00:00 2001 From: Bobby <30593201+luciferreeves@users.noreply.github.com> Date: Mon, 29 Dec 2025 10:46:00 +0530 Subject: feat: Enhance email viewer with new UI actions, sender profile pictures, and raw header display. --- models/email.go | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'models') diff --git a/models/email.go b/models/email.go index 84474b7..5c884ea 100644 --- a/models/email.go +++ b/models/email.go @@ -7,37 +7,37 @@ import ( ) type Email struct { - gorm.Model - UserEmail string - FolderID uint - Folder Folder `gorm:"foreignKey:FolderID"` - - UID uint32 `gorm:"index"` - MessageID string `gorm:"index"` - - From string - FromName string - To string - CC string - BCC string - ReplyTo string - - Subject string - Date time.Time `gorm:"index"` - - BodyText string `gorm:"type:text"` - BodyHTML string `gorm:"type:text"` - Snippet string - - IsRead bool `gorm:"default:false;index"` - IsFlagged bool `gorm:"default:false;index"` + ID uint `gorm:"primaryKey"` + UserEmail string `gorm:"index:idx_user_folder,priority:1;not null"` + FolderID uint `gorm:"index:idx_user_folder,priority:2;not null"` + UID uint32 `gorm:"not null"` + MessageID string `gorm:"index"` + From string `gorm:"not null"` + FromName string + To string `gorm:"not null"` + CC string + BCC string + ReplyTo string + Subject string + Date time.Time `gorm:"index"` + BodyText string `gorm:"type:text"` + BodyHTML string `gorm:"type:text"` + RawHeaders string `gorm:"type:text"` + Snippet string + Size int64 + InReplyTo string + IsRead bool `gorm:"default:false"` + IsFlagged bool `gorm:"default:false"` IsAnswered bool `gorm:"default:false"` IsDraft bool `gorm:"default:false"` - HasAttachment bool `gorm:"default:false;index"` + HasAttachment bool `gorm:"default:false"` + + Folder Folder `gorm:"foreignKey:FolderID"` + Attachments []Attachment `gorm:"foreignKey:EmailID"` - Size int64 - InReplyTo string - References string + CreatedAt time.Time + UpdatedAt time.Time + DeletedAt gorm.DeletedAt `gorm:"index"` } type Attachment struct { -- cgit v1.2.3