2015-03-03 22:10:12 +00:00
|
|
|
from otp.avatar.AvatarHandle import AvatarHandle
|
|
|
|
|
|
|
|
class AvatarFriendInfo(AvatarHandle):
|
|
|
|
|
|
|
|
def __init__(self, avatarName = '', playerName = '', playerId = 0, onlineYesNo = 0, openChatEnabledYesNo = 0, openChatFriendshipYesNo = 0, wlChatEnabledYesNo = 0):
|
|
|
|
self.avatarName = avatarName
|
|
|
|
self.playerName = playerName
|
|
|
|
self.playerId = playerId
|
|
|
|
self.onlineYesNo = onlineYesNo
|
|
|
|
self.openChatEnabledYesNo = openChatEnabledYesNo
|
|
|
|
self.openChatFriendshipYesNo = openChatFriendshipYesNo
|
|
|
|
self.wlChatEnabledYesNo = wlChatEnabledYesNo
|
|
|
|
self.understandableYesNo = self.isUnderstandable()
|
|
|
|
|
|
|
|
def calcUnderstandableYesNo(self):
|
|
|
|
self.understandableYesNo = self.isUnderstandable()
|
|
|
|
|
|
|
|
def getName(self):
|
|
|
|
if self.avatarName:
|
|
|
|
return self.avatarName
|
|
|
|
elif self.playerName:
|
|
|
|
return self.playerName
|
|
|
|
else:
|
|
|
|
return ''
|
|
|
|
|
|
|
|
def isUnderstandable(self):
|
|
|
|
result = False
|
|
|
|
try:
|
|
|
|
if self.openChatFriendshipYesNo:
|
|
|
|
result = True
|
|
|
|
elif self.openChatEnabledYesNo and base.cr.openChatEnabled:
|
|
|
|
result = True
|
2015-04-06 12:48:06 +00:00
|
|
|
elif self.wlChatEnabledYesNo and settings['speedchatPlus']:
|
2015-03-03 22:10:12 +00:00
|
|
|
result = True
|
|
|
|
except:
|
|
|
|
pass
|
|
|
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
def isOnline(self):
|
|
|
|
return self.onlineYesNo
|