Skip to content

Commit

Permalink
Add ClientInfo header on message creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrance committed Mar 10, 2023
1 parent f09e922 commit a24999d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion skpy/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ def getMsgs(self):
return [SkypeMsg.fromRaw(self.skype, json) for json in resp.get("messages", [])]

def createRaw(self, msg):
# All fields except timezone are required; 1418 = desktop client.
client = ("os=Windows; osVer=10; proc=x86; lcid=en-US; deviceType=1; country=US; "
"clientName=skype4life; clientVer=1418/9.99.0.999//skype4life")
resp = self.skype.conn("POST", "{0}/users/ME/conversations/{1}/messages"
.format(self.skype.conn.msgsHost, self.id),
auth=SkypeConnection.Auth.RegToken, json=msg)
auth=SkypeConnection.Auth.RegToken, headers={"ClientInfo": client}, json=msg)
url = resp.headers.get("Location")
msgId = url.rsplit("/", 1)[-1] if url else None
arriveTime = resp.json().get("OriginalArrivalTime")
Expand Down

0 comments on commit a24999d

Please sign in to comment.