Compare commits

...

5 Commits

Author SHA1 Message Date
Alex Corn
e299623452 Use different filenames for different images, similar to how Steam does it 2019-09-25 05:33:14 -04:00
Alex Corn
29b31009ce Merge remote-tracking branch 'origin/master' 2019-09-25 05:30:14 -04:00
Alex Corn
fbfff1398b Merge remote-tracking branch 'origin/master'
# Conflicts:
#	.idea/encodings.xml
2019-02-14 00:29:44 -05:00
Alex Corn
6cd06c3adf Updated module type 2019-02-06 19:54:04 -05:00
Alex Corn
d35e3c107c Make sure CConfirmation.{id, creator} are always strings 2019-02-06 19:36:01 -05:00
3 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />

View File

@@ -5,9 +5,9 @@ module.exports = CConfirmation;
function CConfirmation(community, data) {
Object.defineProperty(this, "_community", {"value": community});
this.id = data.id;
this.id = data.id.toString();
this.type = data.type;
this.creator = data.creator;
this.creator = data.creator.toString();
this.key = data.key;
this.title = data.title;
this.receiving = data.receiving;

View File

@@ -552,6 +552,8 @@ SteamCommunity.prototype.sendImageToUser = function(userID, imageContentsBuffer,
imageHash.update(imageContentsBuffer);
imageHash = imageHash.digest('hex');
var filename = Date.now() + '_image.' + imageDetails.type;
this.httpRequestPost({
uri: 'https://steamcommunity.com/chat/beginfileupload/?l=english',
headers: {
@@ -561,7 +563,7 @@ SteamCommunity.prototype.sendImageToUser = function(userID, imageContentsBuffer,
sessionid: this.getSessionID(),
l: 'english',
file_size: imageContentsBuffer.length,
file_name: 'image.' + imageDetails.type,
file_name: filename,
file_sha: imageHash,
file_image_width: imageDetails.width,
file_image_height: imageDetails.height,
@@ -623,7 +625,7 @@ SteamCommunity.prototype.sendImageToUser = function(userID, imageContentsBuffer,
formData: { // it's multipart again
sessionid: this.getSessionID(),
l: 'english',
file_name: 'image.' + imageDetails.type,
file_name: filename,
file_sha: imageHash,
success: '1',
ugcid: startResult.ugcid,