from core.config import EJ_URL, DEBUG import requests def ej_execute(command, data): """ API request to jabber server """ url = EJ_URL + command if DEBUG: print(f"[URL]: {url}") res = requests.post(url, json=data) return res def pick_support(): return "support" def get_rooms(service, order_num, support, client, provider): """ Create names and member list for each room. Returns a dict {room_name: ("member1", "member2", ...)} """ service = service.lower() # Set room names room_name1 = "_".join(str(attr) for attr in (service, order_num, client, support)) room_name2 = "_".join(str(attr) for attr in (service, order_num, client, "with", provider)) room_name3 = "_".join(str(attr) for attr in (service, order_num, provider, support)) # Set room participants rooms = { room_name1: ("client", "support", "owner"), room_name2: ("client", "provider", "owner"), room_name3: ("provider", "support", "owner"), } return rooms