aboutsummaryrefslogtreecommitdiff
path: root/api/social/friend_accept.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/friend_accept.py
parenteed11fd96cf1458a7a91659cdf5efafbadda1b2b (diff)
changedRelation api event
Diffstat (limited to 'api/social/friend_accept.py')
-rw-r--r--api/social/friend_accept.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/api/social/friend_accept.py b/api/social/friend_accept.py
index bc850d2..8340274 100644
--- a/api/social/friend_accept.py
+++ b/api/social/friend_accept.py
@@ -1,6 +1,7 @@
from flask import Blueprint, request
from db import cursor, connection
from auth.login_token import token_login
+from socket_io import io
import time
accept = Blueprint('accept', __name__)
@@ -23,6 +24,9 @@ def route():
[user_1_id, user_2_id])
connection.commit()
+ 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
dynamic_route = ["/social", accept]