Longi94 / JavaSteam

Java library that provides an interface to directly interact with Valve's Steam servers.
MIT License
95 stars 20 forks source link

Add support for uploading images (chat) #45

Open Longi94 opened 5 years ago

LossyDragon commented 2 years ago

This is a "Unified Messages" feature.

I'm not sure how images are being uploaded physically. But doing a quick glance with NHA2, I see 4 messages when uploading an image:

  1. ServiceMethod (in) CloudClient.NotifyAppStateChange#1
  2. ServiceMethodCallFromClient (out) Cloud.GetAppFileChangelist#1
  3. ServiceMethod (in) FriendMessagesClient.IncomingMessage#1
  4. ServiceMethodResponse (in) Cloud.GetAppFileChangelist#1

Step 3 is just an incoming response of the chat message, containing the image in bbcode Step 4 appears to be a list of recent uploaded images.

LossyDragon commented 5 months ago

I looked into this more and found the mobile app and web chat use the following urls when uploading.

https://steam-chat.com/chat/beginfileupload/ https://steam-chat.com/chat/commitfileupload/

With this information, I looked online and noticed steam.py has already implemented this, this may be a good point to understand and possibly implement

https://github.com/Gobot1234/steam.py/blob/ba5d8199898f133543ce77dab127958c0228d352/steam/http.py#L1095