Skip to content

Commit

Permalink
core: use python string and not stringview when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
borisfaure committed Jun 14, 2010
1 parent ba2de4d commit 395c80a
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions amsn2/core/personalinfo_manager.py
Expand Up @@ -18,20 +18,14 @@ def set_account(self, amsn_account):
# set nickname at login
# could be overriden by the one set in the saved account
# TODO: add setting display picture
strv = StringView()
nick = str(amsn_account.view.nick)
if nick and nick != amsn_account.view.email:
strv.append_text(nick)
else:
strv.append_text(self._papyon_profile.display_name)
self._personalinfoview.nick = strv
if !nick or nick == amsn_account.view.email:
nick = self._papyon_profile.display_name
self._personalinfoview.nick = nick

# TODO: The psm doesn't seem to get fetched from server. Papyon issue?
strv = StringView()
psm = str(amsn_account.view.psm)
if psm:
strv.append_text(psm)
self._personalinfoview.psm = strv
self._personalinfoview.psm = psm

# set login presence, from this moment the client appears to the others
self._personalinfoview.presence = self._core.p2s[amsn_account.view.presence]
Expand All @@ -49,8 +43,8 @@ def _on_presence_changed(self, new_presence):
# TODO: manage custom presence
for key in self._core.p2s:
if self._core.p2s[key] == new_presence:
break
self._papyon_profile.presence = key
self._papyon_profile.presence = key
return

def _on_DP_change_request(self):
self._core._ui_manager.load_DP_chooser_window()
Expand Down

0 comments on commit 395c80a

Please sign in to comment.