Skip to content

Commit

Permalink
Add method to change mood message
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrance committed Oct 5, 2016
1 parent 99c2a48 commit 55e2fcd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion skpy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .core import SkypeObj, SkypeEnum
from .util import SkypeUtils
from .conn import SkypeConnection
from .user import SkypeContact, SkypeContacts
from .user import SkypeUser, SkypeContact, SkypeContacts
from .chat import SkypeChats
from .event import SkypeEvent

Expand Down Expand Up @@ -129,6 +129,17 @@ def setPresence(self, status=SkypeUtils.Status.Online):
self.conn("PUT", "{0}/users/ME/presenceDocs/messagingService".format(self.conn.msgsHost),
auth=SkypeConnection.Auth.RegToken, json={"status": status.label})

def setMood(self, mood):
"""
Update the activity message for the current user.
Args:
mood (str): new mood message
"""
self.conn("POST", "{0}/users/{1}/profile/partial".format(SkypeConnection.API_USER, self.userId),
auth=SkypeConnection.Auth.SkypeToken, json={"payload": {"mood": mood or ""}})
self.user.mood = SkypeUser.Mood(plain=mood) if mood else None

def setAvatar(self, image):
"""
Update the profile picture for the current user.
Expand Down

0 comments on commit 55e2fcd

Please sign in to comment.