aboutsummaryrefslogtreecommitdiff
path: root/api/social/destroy_relation.py
diff options
context:
space:
mode:
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__)