skpy/chat.py
def recent(self):
        """
        Retrieve a selection of conversations with the most recent activity, and store them in the cache.

        Each conversation is only retrieved once, so subsequent calls will retrieve older conversations.

        Returns:
            :class:`SkypeChat` list: collection of recent conversations
        """
        url = "{0}/users/ME/conversations".format(self.skype.conn.msgsHost)
        params = {"startTime": 0,
                  "view": "msnp24Equivalent",
                  "targetType": "Passport|Skype|Lync|Thread"}
        resp = self.skype.conn.syncStateCall("GET", url, params, auth=SkypeConnection.Auth.RegToken).json()
        chats = {}
        for json in resp.get("conversations", []):
            cls = SkypeSingleChat
            if "threadProperties" in json:
                info = self.skype.conn("GET", "{0}/threads/{1}".format(self.skype.conn.msgsHost, json.get("id")),
                                       auth=SkypeConnection.Auth.RegToken,
                                       params={"view": "msnp24Equivalent"}).json()
                json.update(info)
                cls = SkypeGroupChat
            chats[json.get("id")] = self.merge(cls.fromRaw(self.skype, json))
        return chats
def recent(self):
        url = "{0}/users/ME/conversations".format(self.skype.conn.msgsHost)
        params = {"startTime": 0,
                  "view": "msnp24Equivalent",
                  "targetType": "Passport|Skype|Lync|Thread"}
        resp = self.skype.conn.syncStateCall("GET", url, params, auth=SkypeConnection.Auth.RegToken).json()
        chats = {}
        for json in resp.get("conversations", []):
            cls = SkypeSingleChat
            if "threadProperties" in json:
                info = self.skype.conn("GET", "{0}/threads/{1}".format(self.skype.conn.msgsHost, json.get("id")),
                                       auth=SkypeConnection.Auth.RegToken,
                                       params={"view": "msnp24Equivalent"}).json()
                json.update(info)
                cls = SkypeGroupChat
            chats[json.get("id")] = self.merge(cls.fromRaw(self.skype, json))
        return chats
def recent ( self ) : url = "{0}/users/ME/conversations" . format ( self . skype . conn . msgsHost ) params = { "startTime" : 0 , "view" : "msnp24Equivalent" , "targetType" : "Passport|Skype|Lync|Thread" } resp = self . skype . conn . syncStateCall ( "GET" , url , params , auth = SkypeConnection . Auth . RegToken ) . json ( ) chats = { } for json in resp . get ( "conversations" , [ ] ) : cls = SkypeSingleChat if "threadProperties" in json : info = self . skype . conn ( "GET" , "{0}/threads/{1}" . format ( self . skype . conn . msgsHost , json . get ( "id" ) ) , auth = SkypeConnection . Auth . RegToken , params = { "view" : "msnp24Equivalent" } ) . json ( ) json . update ( info ) cls = SkypeGroupChat chats [ json . get ( "id" ) ] = self . merge ( cls . fromRaw ( self . skype , json ) ) return chats
Retrieve a selection of conversations with the most recent activity, and store them in the cache.

        Each conversation is only retrieved once, so subsequent calls will retrieve older conversations.

        Returns:
            :class:`SkypeChat` list: collection of recent conversations
Retrieve a selection of conversations with the most recent activity and store them in the cache .