[MM-40573] Stop asterisk detection on versions newer than 5.28, force space for the others (#1931)

* [MM-40573] Stop asking detection on versions newer than 5.29, force space for the others

* PR feedback and test fixes
This commit is contained in:
Devin Binnie
2021-12-23 16:49:53 -05:00
committed by GitHub
parent c28b219362
commit bd470459c2
2 changed files with 11 additions and 2 deletions

View File

@@ -326,13 +326,17 @@ export class MattermostView extends EventEmitter {
}
}
titleParser = /(\((\d+)\) )?(\*)?/g
titleParser = /(\((\d+)\) )?(\* )?/g
handleTitleUpdate = (e: Event, title: string) => {
this.updateMentionsFromTitle(title);
}
updateMentionsFromTitle = (title: string) => {
if (this.serverInfo.remoteInfo.serverVersion && Util.isVersionGreaterThanOrEqualTo(this.serverInfo.remoteInfo.serverVersion, '5.29.0')) {
return;
}
//const title = this.view.webContents.getTitle();
const resultsIterator = title.matchAll(this.titleParser);
const results = resultsIterator.next(); // we are only interested in the first set