Save Peer History Settings
This commit is contained in:
parent
0677dc308b
commit
c18844a0d5
|
@ -6,4 +6,5 @@ type Contact struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Picture string `json:"picture"`
|
Picture string `json:"picture"`
|
||||||
Authorization string `json:"authorization"`
|
Authorization string `json:"authorization"`
|
||||||
|
SaveHistory string `json:"saveConversationHistory"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,11 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string {
|
||||||
cpicPath := GetPicturePath(cpic)
|
cpicPath := GetPicturePath(cpic)
|
||||||
contactInfo := profile.GetContact(contact)
|
contactInfo := profile.GetContact(contact)
|
||||||
name, _ := contactInfo.GetAttribute(attr.GetLocalScope(constants.Name))
|
name, _ := contactInfo.GetAttribute(attr.GetLocalScope(constants.Name))
|
||||||
contacts = append(contacts, Contact{Name: name, Onion: contactInfo.Onion, Status: contactInfo.State, Picture: cpicPath, Authorization: string(contactInfo.Authorization)})
|
saveHistory, set := contactInfo.GetAttribute(event.SaveHistoryKey)
|
||||||
|
if !set {
|
||||||
|
saveHistory = event.DeleteHistoryDefault
|
||||||
|
}
|
||||||
|
contacts = append(contacts, Contact{Name: name, Onion: contactInfo.Onion, Status: contactInfo.State, Picture: cpicPath, Authorization: string(contactInfo.Authorization), SaveHistory: saveHistory})
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes, _ := json.Marshal(contacts)
|
bytes, _ := json.Marshal(contacts)
|
||||||
|
|
Loading…
Reference in New Issue