This commit is contained in:
nnduc
2026-10-24 14:03:52 +07:00
commit 4fe046de58
4790 changed files with 311146 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import asyncio, json
from e2e import Client
async def main():
alice = Client("alice@localhost", "alicepass")
bob = Client("bob@localhost", "bobpass")
await alice.login(); await bob.login()
await alice.call("Notifications", "ajaxAdd", [{"searchjid": {"value": "bob@localhost"}, "alias": {"value": "Bob"}, "group": {"value": "Friends"}}])
await bob.recv_until(lambda m: m.get("func") == "Notifications.setCounters" and m["p"][0] not in ("", 0), timeout=10)
print("bob got the request")
await bob.call("Notifications", "ajaxAccept", ["alice@localhost"])
await asyncio.sleep(3)
await alice.call("Search", "ajaxHttpInitRoster")
m = await alice.recv_until(lambda m: m.get("func") == "MovimTpl.fill" and m["p"][0] == "#roster")
print("alice roster has bob:", "bob@localhost" in m["p"][1], "online:", "status online" in m["p"][1])
asyncio.run(main())