aboutsummaryrefslogtreecommitdiff
path: root/api/social/destroy_relation.py
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-21 11:30:04 +0100
committerlonkaars <l.leblansch@gmail.com>2021-03-21 11:30:04 +0100
commitd8169484077c4ce25e195747602f06bce9d4ded0 (patch)
tree3c523fefec52e7ed801532d08bcebdd2511258c3 /api/social/destroy_relation.py
parenteed11fd96cf1458a7a91659cdf5efafbadda1b2b (diff)
changedRelation api event
Diffstat (limited to 'api/social/destroy_relation.py')
-rw-r--r--api/social/destroy_relation.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/api/social/destroy_relation.py b/api/social/destroy_relation.py
index 09b42f0..a08175f 100644
--- a/api/social/destroy_relation.py
+++ b/api/social/destroy_relation.py
@@ -3,6 +3,7 @@ from db import cursor
from auth.login_token import token_login
from social.create_relation import remove_relation
from user.info import get_relation_to
+from socket_io import io
import time
remove = Blueprint('remove', __name__)
@@ -22,10 +23,14 @@ def index():
return "", 403
relation = get_relation_to(user_1_id, user_2_id)
- if relation == "none": return 403
+ if relation == "none": return "", 403
remove_relation(user_1_id, user_2_id)
remove_relation(user_2_id, user_1_id)
+
+ io.emit("changedRelation", { "id": user_2_id }, room="user-"+user_1_id)
+ io.emit("changedRelation", { "id": user_1_id }, room="user-"+user_2_id)
+
return "", 200
unblock = Blueprint('unblock', __name__)