Commit fea76ae1 authored by zauberstuhl's avatar zauberstuhl

Check if entity exists before relaying retraction

parent 56c541c4
......@@ -31,9 +31,6 @@ func (r *Receiver) Retraction(entity federation.MessageRetract) {
}
defer db.Close()
// relay retraction before deleting database entries!
(&Dispatcher{Message: entity}).Run()
var dbModel interface{}
switch entity.ParentType() {
case federation.Reshare:
......@@ -83,6 +80,9 @@ func (r *Receiver) Retraction(entity federation.MessageRetract) {
}
if dbModel != nil {
// relay retraction before deleting database entries!
(&Dispatcher{Message: entity}).Run()
err = db.Delete(dbModel).Error
if err != nil {
revel.AppLog.Error(err.Error())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment