From 55e2fcda0e6e213f1d52b456635a61774305bb89 Mon Sep 17 00:00:00 2001 From: Ollie Terrance Date: Wed, 5 Oct 2016 22:23:42 +0100 Subject: [PATCH] Add method to change mood message --- skpy/main.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/skpy/main.py b/skpy/main.py index 99807e9..2e3f945 100644 --- a/skpy/main.py +++ b/skpy/main.py @@ -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 @@ -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.