Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a8df0a548f | ||
|
13d0dc4ba4 | ||
|
64125a1aca | ||
|
4feae03092 | ||
|
5f993c2bf8 | ||
|
35bbcbffba | ||
|
5faca54d67 |
@@ -17,7 +17,7 @@ from .client import *
|
||||
|
||||
|
||||
__copyright__ = 'Copyright 2015 - {} by Taehoon Kim'.format(datetime.now().year)
|
||||
__version__ = '1.0.5'
|
||||
__version__ = '1.0.8'
|
||||
__license__ = 'BSD'
|
||||
__author__ = 'Taehoon Kim; Moreels Pieter-Jan; Mads Marquart'
|
||||
__email__ = 'carpedm20@gmail.com'
|
||||
|
@@ -1012,6 +1012,7 @@ class Client(object):
|
||||
:type thread_type: models.ThreadType
|
||||
:raises: Exception if request failed
|
||||
"""
|
||||
|
||||
thread_id, thread_type = self._getThread(thread_id, thread_type)
|
||||
|
||||
if thread_type == ThreadType.USER:
|
||||
@@ -1024,6 +1025,8 @@ class Client(object):
|
||||
data['log_message_data[name]'] = title
|
||||
data['log_message_type'] = 'log:thread-name'
|
||||
|
||||
return self._doSendRequest(data)
|
||||
|
||||
def changeNickname(self, nickname, user_id, thread_id=None, thread_type=ThreadType.USER):
|
||||
"""
|
||||
Changes the nickname of a user in a thread
|
||||
|
@@ -26,9 +26,11 @@ class ConcatJSONDecoder(json.JSONDecoder):
|
||||
def graphql_color_to_enum(color):
|
||||
if color is None:
|
||||
return None
|
||||
if len(color) == 0:
|
||||
return ThreadColor.MESSENGER_BLUE
|
||||
try:
|
||||
return ThreadColor('#{}'.format(color[2:].lower()))
|
||||
except KeyError:
|
||||
except ValueError:
|
||||
raise Exception('Could not get ThreadColor from color: {}'.format(color))
|
||||
|
||||
def get_customization_info(thread):
|
||||
@@ -44,7 +46,7 @@ def get_customization_info(thread):
|
||||
rtn['nicknames'] = {}
|
||||
for k in info['participant_customizations']:
|
||||
rtn['nicknames'][k['participant_id']] = k.get('nickname')
|
||||
else:
|
||||
elif info.get('participant_customizations'):
|
||||
_id = thread.get('thread_key', {}).get('other_user_id') or thread.get('id')
|
||||
if info['participant_customizations'][0]['participant_id'] == _id:
|
||||
rtn['nickname'] = info['participant_customizations'][0]
|
||||
|
Reference in New Issue
Block a user