From b60eace0a5410fbf3a6f841b6eeb35f4175e1653 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sun, 2 Oct 2022 17:12:02 +0200 Subject: [PATCH] stuff --- Library/_res/0BDFDB.data.json | 7 +++++-- Plugins/BetterFriendList/BetterFriendList.plugin.js | 2 +- .../CustomStatusPresets/CustomStatusPresets.plugin.js | 4 ++-- .../FriendNotifications/FriendNotifications.plugin.js | 10 +++++----- .../NotificationSounds/NotificationSounds.plugin.js | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 1449921a44..4f012f4c68 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -59,7 +59,6 @@ "ReadStateTypes": ["GUILD_EVENT", "NOTIFICATION_CENTER", "CHANNEL"], "RelationshipTypes": ["FRIEND", "PENDING_INCOMING", "PENDING_OUTGOING"], "Routes": ["CHANNEL_THREAD_VIEW", "MESSAGE_REQUESTS"], - "StatusTypes": ["STREAMING", "UNKNOWN", "DND"], "UserFlags": ["HYPESQUAD", "BUG_HUNTER_LEVEL_1", "STAFF"], "UserNotificationSettings": ["NULL", "NO_MESSAGES", "ALL_MESSAGES"], "UserSettingsActionTypes": ["SLOW_USER_ACTION", "DAILY"], @@ -475,7 +474,11 @@ "Types": ["WANDERING_CUBES", "CHASING_DOTS"], "Spinner": ["LOADING"] }}, - "Status": {"name": "Status"}, + "StatusComponents": {"strings": ["{mask", ".mask,", "UNKNOWN"], "exported": false, "value": "exports", "map": { + "AnimatedStatus": ["useSpring"], + "Status": [".mask,"], + "Types": ["UNKNOWN", "INVISIBLE"] + }}, "StatusPickerPopout": {"strings": ["\"StatusPickerPopout\""], "value": "default"}, "TextElement": {"strings": [".strong,", ".STANDARD"]}, "Timeout": {"protos": ["start", "stop", "isStarted"]}, diff --git a/Plugins/BetterFriendList/BetterFriendList.plugin.js b/Plugins/BetterFriendList/BetterFriendList.plugin.js index 249019ce96..523ab3c026 100644 --- a/Plugins/BetterFriendList/BetterFriendList.plugin.js +++ b/Plugins/BetterFriendList/BetterFriendList.plugin.js @@ -246,7 +246,7 @@ module.exports = (_ => { newChildren.push(this.createBadge(favorizedFriends.filter(id => relationships[id] == BDFDB.DiscordConstants.RelationshipTypes.FRIEND).length)); break; case BDFDB.DiscordConstants.FriendsSections.ONLINE: - newChildren.push(this.createBadge(Object.entries(relationships).filter(n => n[1] == BDFDB.DiscordConstants.RelationshipTypes.FRIEND && !(this.settings.general.addHiddenCategory && hiddenFriends.indexOf(n[0]) > -1) && BDFDB.LibraryStores.PresenceStore.getStatus(n[0]) != BDFDB.DiscordConstants.StatusTypes.OFFLINE).length)); + newChildren.push(this.createBadge(Object.entries(relationships).filter(n => n[1] == BDFDB.DiscordConstants.RelationshipTypes.FRIEND && !(this.settings.general.addHiddenCategory && hiddenFriends.indexOf(n[0]) > -1) && BDFDB.LibraryStores.PresenceStore.getStatus(n[0]) != BDFDB.LibraryComponents.StatusComponents.Types.OFFLINE).length)); break; case BDFDB.DiscordConstants.FriendsSections.PENDING: newChildren.push(this.createBadge(relationshipCount[BDFDB.DiscordConstants.RelationshipTypes.PENDING_INCOMING], this.labels.incoming, relationshipCount[BDFDB.DiscordConstants.RelationshipTypes.PENDING_INCOMING] > 0)); diff --git a/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js b/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js index c1f7c4bd87..e9304e0b12 100644 --- a/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js +++ b/Plugins/CustomStatusPresets/CustomStatusPresets.plugin.js @@ -372,9 +372,9 @@ module.exports = (_ => { }) }) }), - BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Status, { + BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, { className: BDFDB.disCN._customstatuspresetsstatus, - status: presets[id].status || BDFDB.DiscordConstants.StatusTypes.ONLINE + status: presets[id].status || BDFDB.LibraryComponents.StatusComponents.Types.ONLINE }), BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, { children: presets[id].text diff --git a/Plugins/FriendNotifications/FriendNotifications.plugin.js b/Plugins/FriendNotifications/FriendNotifications.plugin.js index fc04f064f1..97ea85c8b0 100644 --- a/Plugins/FriendNotifications/FriendNotifications.plugin.js +++ b/Plugins/FriendNotifications/FriendNotifications.plugin.js @@ -796,7 +796,7 @@ module.exports = (_ => { } getOnlineCount () { - return Object.entries(BDFDB.LibraryStores.RelationshipStore.getRelationships()).filter(n => n[1] == BDFDB.DiscordConstants.RelationshipTypes.FRIEND && BDFDB.LibraryStores.PresenceStore.getStatus(n[0]) != BDFDB.DiscordConstants.StatusTypes.OFFLINE).length; + return Object.entries(BDFDB.LibraryStores.RelationshipStore.getRelationships()).filter(n => n[1] == BDFDB.DiscordConstants.RelationshipTypes.FRIEND && BDFDB.LibraryStores.PresenceStore.getStatus(n[0]) != BDFDB.LibraryComponents.StatusComponents.Types.OFFLINE).length; } startInterval () { @@ -821,7 +821,7 @@ module.exports = (_ => { let status = this.getStatusWithMobileAndActivity(id, observedUsers[id], clientStatuses); let transitionChannelId = null; let customChanged = false, loginNotice = false, screensharingNotice = false; - if (user && (!observedUsers[id][status.name] && observedUsers[id].login && status.name != BDFDB.DiscordConstants.StatusTypes.OFFLINE && userStatusStore[id].name == BDFDB.DiscordConstants.StatusTypes.OFFLINE && (loginNotice = true) || observedUsers[id][status.name] && ( + if (user && (!observedUsers[id][status.name] && observedUsers[id].login && status.name != BDFDB.LibraryComponents.StatusComponents.Types.OFFLINE && userStatusStore[id].name == BDFDB.LibraryComponents.StatusComponents.Types.OFFLINE && (loginNotice = true) || observedUsers[id][status.name] && ( observedUsers[id].custom && ( userStatusStore[id].custom != status.custom && ((customChanged = status.custom) || true) || (customChanged = status.custom && !this.activityIsSame(id, status)) @@ -854,7 +854,7 @@ module.exports = (_ => { timestamp: timestamp }); - if (!(this.settings.general.muteOnDND && BDFDB.UserUtils.getStatus() == BDFDB.DiscordConstants.StatusTypes.DND) && (!lastTimes[user.id] || lastTimes[user.id] != timestamp)) { + if (!(this.settings.general.muteOnDND && BDFDB.UserUtils.getStatus() == BDFDB.LibraryComponents.StatusComponents.Types.DND) && (!lastTimes[user.id] || lastTimes[user.id] != timestamp)) { lastTimes[user.id] = timestamp; let openChannel = _ => { @@ -921,12 +921,12 @@ module.exports = (_ => { } createStatusDot (status, isMobile, style = {}) { - return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Status, { + return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, { style: Object.assign({}, style), size: 12, color: isMobile ? BDFDB.UserUtils.getStatusColor(status, true) : null, isMobile: isMobile, - status: isMobile ? BDFDB.DiscordConstants.StatusTypes.ONLINE : status + status: isMobile ? BDFDB.LibraryComponents.StatusComponents.Types.ONLINE : status }); } diff --git a/Plugins/NotificationSounds/NotificationSounds.plugin.js b/Plugins/NotificationSounds/NotificationSounds.plugin.js index 6da50fe869..31eea0039d 100644 --- a/Plugins/NotificationSounds/NotificationSounds.plugin.js +++ b/Plugins/NotificationSounds/NotificationSounds.plugin.js @@ -489,10 +489,10 @@ module.exports = (_ => { mini: true, grow: 0, label: "Mute in", - labelChildren: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Status, { + labelChildren: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.StatusComponents.Status, { style: {marginLeft: 6}, size: 12, - status: BDFDB.DiscordConstants.StatusTypes.DND + status: BDFDB.LibraryComponents.StatusComponents.Types.DND }), value: choices[type].mute, onChange: value => {