@@ -412,6 +412,78 @@ def log(self, message):
412
412
}
413
413
414
414
self .__do_request (post_data )
415
+
416
+ def fetchOnline (self ):
417
+ self .checkinit ()
418
+ init_iv = SHA256 .new (str (uuid4 ())[:8 ].encode ()).hexdigest ()
419
+
420
+ post_data = {
421
+ "type" : binascii .hexlify (("fetchOnline" ).encode ()),
422
+ "sessionid" : binascii .hexlify (self .sessionid .encode ()),
423
+ "name" : binascii .hexlify (self .name .encode ()),
424
+ "ownerid" : binascii .hexlify (self .ownerid .encode ()),
425
+ "init_iv" : init_iv
426
+ }
427
+
428
+ response = self .__do_request (post_data )
429
+ response = encryption .decrypt (response , self .enckey , init_iv )
430
+
431
+ json = jsond .loads (response )
432
+
433
+ if json ["success" ]:
434
+ if json ["users" ]["0" ]:
435
+ return None ## THIS IS ISSUE ON KEYAUTH SERVER SIDE 6.8.2022 so it will return none if it is not an array.
436
+ else :
437
+ return json ["users" ]
438
+ else :
439
+ return None
440
+
441
+ def chatGet (self , channel ):
442
+ self .checkinit ()
443
+ init_iv = SHA256 .new (str (uuid4 ())[:8 ].encode ()).hexdigest ()
444
+
445
+ post_data = {
446
+ "type" : binascii .hexlify (("chatget" ).encode ()),
447
+ "channel" : encryption .encrypt (channel , self .enckey , init_iv ),
448
+ "sessionid" : binascii .hexlify (self .sessionid .encode ()),
449
+ "name" : binascii .hexlify (self .name .encode ()),
450
+ "ownerid" : binascii .hexlify (self .ownerid .encode ()),
451
+ "init_iv" : init_iv
452
+ }
453
+
454
+ response = self .__do_request (post_data )
455
+ response = encryption .decrypt (response , self .enckey , init_iv )
456
+
457
+ json = jsond .loads (response )
458
+
459
+ if json ["success" ]:
460
+ return json ["messages" ]
461
+ else :
462
+ return None
463
+
464
+ def chatSend (self , message , channel ):
465
+ self .checkinit ()
466
+ init_iv = SHA256 .new (str (uuid4 ())[:8 ].encode ()).hexdigest ()
467
+
468
+ post_data = {
469
+ "type" : binascii .hexlify (("chatsend" ).encode ()),
470
+ "message" : encryption .encrypt (message , self .enckey , init_iv ),
471
+ "channel" : encryption .encrypt (channel , self .enckey , init_iv ),
472
+ "sessionid" : binascii .hexlify (self .sessionid .encode ()),
473
+ "name" : binascii .hexlify (self .name .encode ()),
474
+ "ownerid" : binascii .hexlify (self .ownerid .encode ()),
475
+ "init_iv" : init_iv
476
+ }
477
+
478
+ response = self .__do_request (post_data )
479
+ response = encryption .decrypt (response , self .enckey , init_iv )
480
+
481
+ json = jsond .loads (response )
482
+
483
+ if json ["success" ]:
484
+ return True
485
+ else :
486
+ return False
415
487
416
488
def checkinit (self ):
417
489
if not self .initialized :
@@ -430,7 +502,7 @@ class application_data_class:
430
502
numUsers = numKeys = app_ver = customer_panel = onlineUsers = ""
431
503
# region user_data
432
504
class user_data_class :
433
- username = ip = hwid = expires = createdate = lastlogin = subscription = ""
505
+ username = ip = hwid = expires = createdate = lastlogin = subscription = subscriptions ""
434
506
435
507
user_data = user_data_class ()
436
508
app_data = application_data_class ()
0 commit comments