mirror of
https://github.com/status-im/status-go.git
synced 2025-02-18 01:37:22 +00:00
fix: add option to preserve history on chat delete (#4324)
This commit is contained in:
parent
0f98a1294c
commit
1b8b53b118
@ -383,7 +383,9 @@ func (m *Messenger) DeactivateChat(request *requests.DeactivateChat) (*Messenger
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return m.deactivateChat(request.ID, 0, true, true)
|
doClearHistory := !request.PreserveHistory
|
||||||
|
|
||||||
|
return m.deactivateChat(request.ID, 0, true, doClearHistory)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Messenger) deactivateChat(chatID string, deactivationClock uint64, shouldBeSynced bool, doClearHistory bool) (*MessengerResponse, error) {
|
func (m *Messenger) deactivateChat(chatID string, deactivationClock uint64, shouldBeSynced bool, doClearHistory bool) (*MessengerResponse, error) {
|
||||||
|
@ -8,6 +8,7 @@ var ErrDeactivateChatInvalidID = errors.New("deactivate-chat: invalid id")
|
|||||||
|
|
||||||
type DeactivateChat struct {
|
type DeactivateChat struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
PreserveHistory bool `json:"preserveHistory"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j *DeactivateChat) Validate() error {
|
func (j *DeactivateChat) Validate() error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user