Skip to content

Commit

Permalink
Delete messages (#2279)
Browse files Browse the repository at this point in the history
* feat: add api and handling to delete messages

* fix(delete): add whitelist to message types that can be deleted
  • Loading branch information
jrainville authored Jul 26, 2021
1 parent 7343b1b commit cdc7c55
Show file tree
Hide file tree
Showing 29 changed files with 1,218 additions and 426 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.83.1
0.83.2
452 changes: 264 additions & 188 deletions appdatabase/migrations/bindata.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions mailserver/migrations/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

144 changes: 93 additions & 51 deletions multiaccounts/migrations/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions protocol/common/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ type Message struct {

// EditedAt indicates the clock value it was edited
EditedAt uint64 `json:"editedAt"`

// Deleted indicates if a message was deleted
Deleted bool `json:"deleted"`
}

func (m *Message) MarshalJSON() ([]byte, error) {
Expand Down Expand Up @@ -194,6 +197,7 @@ func (m *Message) MarshalJSON() ([]byte, error) {
Mentioned bool `json:"mentioned,omitempty"`
Links []string `json:"links,omitempty"`
EditedAt uint64 `json:"editedAt,omitempty"`
Deleted bool `json:"deleted,omitempty"`
}{
ID: m.ID,
WhisperTimestamp: m.WhisperTimestamp,
Expand Down Expand Up @@ -226,6 +230,7 @@ func (m *Message) MarshalJSON() ([]byte, error) {
CommandParameters: m.CommandParameters,
GapParameters: m.GapParameters,
EditedAt: m.EditedAt,
Deleted: m.Deleted,
}
if sticker := m.GetSticker(); sticker != nil {
item.Sticker = &StickerAlias{
Expand Down
Loading

0 comments on commit cdc7c55

Please sign in to comment.