mirror of
https://github.com/NicolasConstant/sengi
synced 2025-02-02 19:46:59 +01:00
commit
640028ca08
@ -32,7 +32,7 @@ addons:
|
||||
|
||||
install:
|
||||
- nvm install 10.9.0
|
||||
- npm install electron-builder@next
|
||||
- npm install electron-builder@22.10.5
|
||||
- npm install
|
||||
- npm rebuild node-sass
|
||||
- export DISPLAY=':99.0'
|
||||
@ -44,4 +44,4 @@ before_script:
|
||||
- sleep 3
|
||||
|
||||
script:
|
||||
- npm run travis
|
||||
- npm run travis
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sengi",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"main": "main-electron.js",
|
||||
"description": "A multi-account desktop client for Mastodon and Pleroma",
|
||||
|
@ -225,7 +225,7 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||
// this.status = state;
|
||||
// } else {
|
||||
if (!this.status || this.status === '') {
|
||||
const uniqueMentions = this.getMentions(this.statusReplyingTo, this.statusReplyingToWrapper.provider);
|
||||
const uniqueMentions = this.getMentions(this.statusReplyingTo);
|
||||
for (const mention of uniqueMentions) {
|
||||
this.status += `@${mention} `;
|
||||
}
|
||||
@ -492,8 +492,20 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||
return cwLength;
|
||||
}
|
||||
|
||||
private getMentions(status: Status, providerInfo: AccountInfo): string[] {
|
||||
const mentions = [status.account.acct, ...status.mentions.map(x => x.acct)];
|
||||
private getMentions(status: Status): string[] {
|
||||
let acct = status.account.acct;
|
||||
if(!acct.includes('@')) {
|
||||
acct += `@${status.account.url.replace('https://', '').split('/')[0]}`
|
||||
}
|
||||
|
||||
const mentions = [acct];
|
||||
status.mentions.forEach(m => {
|
||||
let mentionAcct = m.acct;
|
||||
if(!mentionAcct.includes('@')){
|
||||
mentionAcct += `@${m.url.replace('https://', '').split('/')[0]}`;
|
||||
}
|
||||
mentions.push(mentionAcct);
|
||||
});
|
||||
|
||||
let uniqueMentions = [];
|
||||
for (let mention of mentions) {
|
||||
@ -502,22 +514,10 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
let globalUniqueMentions = [];
|
||||
for (let mention of uniqueMentions) {
|
||||
if (!mention.includes('@')) {
|
||||
if (providerInfo) {
|
||||
mention += `@${providerInfo.instance}`;
|
||||
} else {
|
||||
mention += `@${status.url.replace('https://', '').split('/')[0]}`;
|
||||
}
|
||||
}
|
||||
globalUniqueMentions.push(mention);
|
||||
}
|
||||
|
||||
const selectedUser = this.toolsService.getSelectedAccounts()[0];
|
||||
globalUniqueMentions = globalUniqueMentions.filter(x => x.toLowerCase() !== `${selectedUser.username}@${selectedUser.instance}`.toLowerCase());
|
||||
uniqueMentions = uniqueMentions.filter(x => x.toLowerCase() !== `${selectedUser.username}@${selectedUser.instance}`.toLowerCase());
|
||||
|
||||
return globalUniqueMentions;
|
||||
return uniqueMentions;
|
||||
}
|
||||
|
||||
onCtrlEnter(): boolean {
|
||||
|
Loading…
x
Reference in New Issue
Block a user