Fix sharing a friend's presence on Discord

This commit is contained in:
Samuel Elliott 2022-04-26 13:59:54 +01:00
parent 8f5965913d
commit 9d05161bf3
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6

View File

@ -209,7 +209,7 @@ export class ZncDiscordPresence extends ZncNotifications {
this.show_console_online = argv.showInactivePresence;
this.show_active_event = argv.showEvent;
this.presence_user = argv.friendNsaid ?? data.nsoAccount.user.nsaId;
this.presence_user = argv.friendNsaid ?? data?.nsoAccount.user.nsaId;
}
async init() {
@ -217,7 +217,7 @@ export class ZncDiscordPresence extends ZncNotifications {
'announcements',
this.presence_user ?
this.presence_user === this.data.nsoAccount.user.nsaId ? 'user' :
{friend: this.presence_user, presence: true} : null,
{friend: this.presence_user} : null,
this.presence_user && this.show_active_event ? 'event' : null,
this.user_notifications ? 'user' : null,
this.friend_notifications ? 'friends' : null,
@ -372,7 +372,7 @@ export class ZncDiscordPresence extends ZncNotifications {
const {friends, user, activeevent} = await this.fetch([
this.presence_user ?
this.presence_user === this.data.nsoAccount.user.nsaId ? 'user' :
{friend: this.presence_user, presence: true} : null,
{friend: this.presence_user} : null,
this.presence_user && this.show_active_event ? 'event' : null,
this.user_notifications ? 'user' : null,
this.friend_notifications ? 'friends' : null,