@@ -338,9 +338,12 @@ class SkypeGroupChat(SkypeChat):
338
338
active (bool):
339
339
Whether the full group chat was retrieved from the server. This may be ``False`` if a group conversation
340
340
still appears in the recent list despite being left or deleted.
341
+ moderated (bool):
342
+ Whether the group chat is a Skype Moderated Group.
341
343
"""
342
344
343
- attrs = SkypeChat .attrs + ("topic" , "creatorId" , "userIds" , "adminIds" , "open" , "history" , "picture" , "active" , "moderatedthread" )
345
+ attrs = SkypeChat .attrs + ("topic" , "creatorId" , "userIds" , "adminIds" , "open" , "history" , "picture" , "active" ,
346
+ "moderated" )
344
347
345
348
@classmethod
346
349
def rawToFields (cls , raw = {}, active = False ):
@@ -357,11 +360,11 @@ def rawToFields(cls, raw={}, active=False):
357
360
"creatorId" : SkypeUtils .noPrefix (props .get ("creator" )),
358
361
"userIds" : userIds ,
359
362
"adminIds" : adminIds ,
363
+ "moderated" : props .get ("moderatedthread" ) == "true" ,
360
364
"open" : props .get ("joiningenabled" , "" ) == "true" ,
361
365
"history" : props .get ("historydisclosed" , "" ) == "true" ,
362
366
"picture" : props .get ("picture" , "" )[4 :] or None ,
363
- "active" : active ,
364
- "moderatedthread" : props .get ("moderatedthread" )})
367
+ "active" : active })
365
368
return fields
366
369
367
370
@property
@@ -382,16 +385,17 @@ def setTopic(self, topic):
382
385
auth = SkypeConnection .Auth .RegToken , params = {"name" : "topic" }, json = {"topic" : topic })
383
386
self .topic = topic
384
387
385
- def setModerated (self , moderate = True ):
388
+ def setModerated (self , moderated = True ):
386
389
"""
387
390
Update the chat type, and make chat moderated.
388
391
389
392
Args:
390
- moderate (bool): moderating value. True as default
393
+ moderated (bool): whether to enable moderation restrictions
391
394
"""
392
395
self .skype .conn ("PUT" , "{0}/threads/{1}/properties" .format (self .skype .conn .msgsHost , self .id ),
393
- auth = SkypeConnection .Auth .RegToken , params = {"name" : "moderatedthread" }, json = {"moderatedthread" : moderate })
394
- self .moderatedthread = moderate
396
+ auth = SkypeConnection .Auth .RegToken , params = {"name" : "moderatedthread" },
397
+ json = {"moderatedthread" : moderated })
398
+ self .moderated = moderated
395
399
396
400
def setOpen (self , open ):
397
401
"""
@@ -509,12 +513,12 @@ def create(self, members=(), admins=(), moderated=False):
509
513
Create a new group chat with the given users.
510
514
511
515
The current user is automatically added to the conversation as an admin. Any other admin identifiers must also
512
- be present in the member list. You can also make the chat moderated by passing moderated value
516
+ be present in the member list.
513
517
514
518
Args:
515
519
members (str list): user identifiers to initially join the conversation
516
520
admins (str list): user identifiers to gain admin privileges
517
- moderate (bool): moderating value. False as default
521
+ moderate (bool): whether to enable moderation restrictions
518
522
519
523
Returns:
520
524
:class:`SkypeGroupChat`: newly created group conversation
0 commit comments