Skip to content

Commit ff2b1f1

Browse files
committed
tag filenames, fix an interface change
1 parent 1066664 commit ff2b1f1

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

index.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,12 @@ class App extends MatrixPuppetBridgeBase {
9898
const otherPeople = participantIds.filter(pid=> !pid.match(/^e:/));
9999
console.log('filtered out myself', otherPeople);
100100
return Promise.map(otherPeople, (senderId) => {
101-
const ghost = this.getIntentFromThirdPartySenderId(senderId);
102-
return ghost.join(matrixRoomId).then(()=>{
103-
console.log('joined ghost', senderId);
104-
}, (err)=>{
105-
console.log('failed to join ghost', senderId, err);
101+
return this.getIntentFromThirdPartySenderId(senderId).then(ghost=>{
102+
return ghost.join(matrixRoomId).then(()=>{
103+
console.log('joined ghost', senderId);
104+
}, (err)=>{
105+
console.log('failed to join ghost', senderId, err);
106+
});
106107
});
107108
});
108109
}).catch(err=>{
@@ -148,7 +149,7 @@ class App extends MatrixPuppetBridgeBase {
148149

149150
sendImageMessageAsPuppetToThirdPartyRoomWithId(id, { url, text }, matrixEvent) {
150151
const { sendGroupMessage, sendMessage } = this.client;
151-
return download.getTempfile(url).then(({path}) => {
152+
return download.getTempfile(url, { tagFilename: true }).then(({path}) => {
152153
const img = path;
153154
return this.prepareToSend(id, matrixEvent).then(({isGroup, handles, service})=>{
154155
return isGroup ? sendGroupMessage(handles, text, img) : sendMessage(id, service, text, img);
@@ -169,9 +170,10 @@ class App extends MatrixPuppetBridgeBase {
169170
].join('\n'));
170171
} else if ( command === 'rename' ) {
171172
const [id, ...rest] = body.split(' ');
172-
const ghost = this.getIntentFromThirdPartySenderId(id);
173-
return ghost.setDisplayName(rest.join(' ')).then(()=>{},(err)=>{
174-
reply(err.stack);
173+
return this.getIntentFromThirdPartySenderId(id).then((ghost) => {
174+
return ghost.setDisplayName(rest.join(' ')).then(()=>{},(err)=>{
175+
reply(err.stack);
176+
});
175177
});
176178
} else {
177179
reply('unrecognized command: '+bangcommand);

0 commit comments

Comments
 (0)