From 5801c5303860155be78dd706f3d85b30d54420ff Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 20 Jan 2023 00:51:48 +0100 Subject: [PATCH] Improvements --- .nvmrc | 2 +- src/OsmUserInfo.ts | 7 +++++-- src/Postbuilder.ts | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.nvmrc b/.nvmrc index e0325e5..0e9dc6b 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.17.1 +v18.13.0 diff --git a/src/OsmUserInfo.ts b/src/OsmUserInfo.ts index cb1d0e7..2a912b8 100644 --- a/src/OsmUserInfo.ts +++ b/src/OsmUserInfo.ts @@ -74,8 +74,11 @@ export default class OsmUserInfo { if(await mastodonApi.hasNoBot(username)){ return undefined } - const useraccount = await mastodonApi.userInfoFor(username) - return useraccount.acct + let useraccount = (await mastodonApi.userInfoFor(username)).acct + if(!useraccount.startsWith("@")){ + useraccount = "@"+useraccount + } + return useraccount } public async getMeLinks(): Promise { diff --git a/src/Postbuilder.ts b/src/Postbuilder.ts index 896911d..909236d 100644 --- a/src/Postbuilder.ts +++ b/src/Postbuilder.ts @@ -274,7 +274,7 @@ export class Postbuilder { } const singleTheme = this._config?.themeWhitelist?.length === 1 ? "/" + this._config.themeWhitelist[0] : "" let toSend: string[] = [ - `${timePeriod}, ${perContributor.keys().length} persons made ${totalStats.total} changes to #OpenStreetMap using https://mapcomplete.osm.be${singleTheme} . + `${timePeriod}, ${perContributor.keys().length} people made ${totalStats.total} changes to #OpenStreetMap using https://mapcomplete.osm.be${singleTheme} . `, ]