Merge pull request 'Force cid conversation to string in DeleteContact event' (#517) from deletecontactfix into master
continuous-integration/drone/push Build is pending
Details
continuous-integration/drone/push Build is pending
Details
Reviewed-on: #517 Reviewed-by: Dan Ballard <dan@openprivacy.ca>
This commit is contained in:
commit
def585b23b
|
@ -46,6 +46,8 @@ func NewEventList(eventType Type, args ...interface{}) Event {
|
||||||
val, vok := args[i+1].(string)
|
val, vok := args[i+1].(string)
|
||||||
if kok && vok {
|
if kok && vok {
|
||||||
data[key] = val
|
data[key] = val
|
||||||
|
} else {
|
||||||
|
log.Errorf("attempted to send a field that could not be parsed to a string: %v %v", args[i], args[i+1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Event{EventType: eventType, EventID: GetRandNumber().String(), Data: data}
|
return Event{EventType: eventType, EventID: GetRandNumber().String(), Data: data}
|
||||||
|
|
|
@ -770,7 +770,7 @@ func (cp *cwtchPeer) DeleteConversation(id int) error {
|
||||||
ci, err := cp.storage.GetConversation(id)
|
ci, err := cp.storage.GetConversation(id)
|
||||||
if err == nil && ci != nil {
|
if err == nil && ci != nil {
|
||||||
log.Debugf("deleting %v", ci)
|
log.Debugf("deleting %v", ci)
|
||||||
cp.eventBus.Publish(event.NewEventList(event.DeleteContact, event.RemotePeer, ci.Handle, event.ConversationID, id))
|
cp.eventBus.Publish(event.NewEventList(event.DeleteContact, event.RemotePeer, ci.Handle, event.ConversationID, strconv.Itoa(id)))
|
||||||
return cp.storage.DeleteConversation(id)
|
return cp.storage.DeleteConversation(id)
|
||||||
}
|
}
|
||||||
return fmt.Errorf("could not delete conversation, did not exist")
|
return fmt.Errorf("could not delete conversation, did not exist")
|
||||||
|
|
Loading…
Reference in New Issue