Skip to content

Commit

Permalink
Merge pull request #414 from t3chguy/develop
Browse files Browse the repository at this point in the history
Change format of uploaded content URL for #406
  • Loading branch information
kegsay authored Apr 13, 2017
2 parents ddd481d + 8dc82c2 commit 363f946
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/models/MatrixAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,16 @@ MatrixAction.fromEvent = function(client, event, mediaUrl) {
var fileSize = "";
if (event.content.info && event.content.info.size &&
typeof event.content.info.size === "number") {
fileSize = " (" + Math.round(event.content.info.size / 1024) +
"KB)";
fileSize = " (" + Math.round(event.content.info.size / 1024) + "KB)";
}

// By default assume that the media server = client homeserver
if (!mediaUrl) {
mediaUrl = client.getHomeserverUrl();
}

text = event.content.body +
fileSize +
" - " +
ContentRepo.getHttpUriForMxc(mediaUrl, event.content.url);
const url = ContentRepo.getHttpUriForMxc(mediaUrl, event.content.url);
text = `${event.content.body}${fileSize} <${url}>`;
}
}
return new MatrixAction(type, text, htmlText, event.origin_server_ts);
Expand Down

0 comments on commit 363f946

Please sign in to comment.