mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 05:55:37 -05:00
bunch of cleanups
This commit is contained in:
@@ -221,6 +221,7 @@ PanelWindow {
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AppSearchService
|
||||
function onApplicationsChanged() {
|
||||
console.log("AppLauncher: DesktopEntries.applicationsChanged signal received");
|
||||
// Update categories when applications change
|
||||
@@ -231,8 +232,6 @@ PanelWindow {
|
||||
}));
|
||||
updateFilteredModel();
|
||||
}
|
||||
|
||||
target: DesktopEntries
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
||||
@@ -868,15 +868,6 @@ PanelWindow {
|
||||
else
|
||||
console.warn("ClipboardHistory: Failed to load clipboard history");
|
||||
}
|
||||
// Handle keyboard shortcuts
|
||||
Keys.onPressed: (event) => {
|
||||
if (event.key === Qt.Key_Escape)
|
||||
clipboardHistory.hide();
|
||||
|
||||
}
|
||||
Component.onCompleted: {
|
||||
focus = true;
|
||||
}
|
||||
|
||||
stdout: SplitParser {
|
||||
splitMarker: "\n"
|
||||
|
||||
@@ -123,7 +123,7 @@ Item {
|
||||
radius: 6
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
z: 10
|
||||
opacity: networkTab.changingNetworkPreference ? 0.6 : 1
|
||||
opacity: NetworkService.changingPreference ? 0.6 : 1
|
||||
visible: NetworkService.networkStatus !== "ethernet" && NetworkService.wifiAvailable && NetworkService.wifiEnabled
|
||||
|
||||
Row {
|
||||
@@ -133,17 +133,17 @@ Item {
|
||||
DankIcon {
|
||||
id: ethernetPreferenceIcon
|
||||
|
||||
name: networkTab.changingNetworkPreference ? "sync" : ""
|
||||
name: NetworkService.changingPreference ? "sync" : ""
|
||||
size: Theme.fontSizeSmall
|
||||
color: networkTab.networkStatus === "ethernet" ? Theme.background : Theme.primary
|
||||
visible: networkTab.changingNetworkPreference
|
||||
visible: NetworkService.changingPreference
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
rotation: networkTab.changingNetworkPreference ? ethernetPreferenceIcon.rotation : 0
|
||||
rotation: NetworkService.changingPreference ? ethernetPreferenceIcon.rotation : 0
|
||||
|
||||
RotationAnimation {
|
||||
target: ethernetPreferenceIcon
|
||||
property: "rotation"
|
||||
running: networkTab.changingNetworkPreference
|
||||
running: NetworkService.changingPreference
|
||||
from: 0
|
||||
to: 360
|
||||
duration: 1000
|
||||
@@ -153,7 +153,7 @@ Item {
|
||||
}
|
||||
|
||||
Text {
|
||||
text: networkTab.changingNetworkPreference ? "Switching..." : (networkTab.networkStatus === "ethernet" ? "" : "Prefer over WiFi")
|
||||
text: NetworkService.changingPreference ? "Switching..." : (networkTab.networkStatus === "ethernet" ? "" : "Prefer over WiFi")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: networkTab.networkStatus === "ethernet" ? Theme.background : Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -167,7 +167,7 @@ Item {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
propagateComposedEvents: false
|
||||
enabled: !networkTab.changingNetworkPreference
|
||||
enabled: !NetworkService.changingPreference
|
||||
onClicked: {
|
||||
console.log("*** ETHERNET PREFERENCE BUTTON CLICKED ***");
|
||||
if (networkTab.networkStatus !== "ethernet") {
|
||||
@@ -356,7 +356,7 @@ Item {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.spacingL + 48 + Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
opacity: networkTab.changingNetworkPreference ? 0.6 : 1
|
||||
opacity: NetworkService.changingPreference ? 0.6 : 1
|
||||
visible: NetworkService.networkStatus !== "wifi" && NetworkService.ethernetConnected && NetworkService.wifiEnabled
|
||||
|
||||
Row {
|
||||
@@ -366,17 +366,17 @@ Item {
|
||||
DankIcon {
|
||||
id: wifiPreferenceIcon
|
||||
|
||||
name: networkTab.changingNetworkPreference ? "sync" : ""
|
||||
name: NetworkService.changingPreference ? "sync" : ""
|
||||
size: Theme.fontSizeSmall
|
||||
color: networkTab.networkStatus === "wifi" ? Theme.background : Theme.primary
|
||||
visible: networkTab.changingNetworkPreference
|
||||
visible: NetworkService.changingPreference
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
rotation: networkTab.changingNetworkPreference ? wifiPreferenceIcon.rotation : 0
|
||||
rotation: NetworkService.changingPreference ? wifiPreferenceIcon.rotation : 0
|
||||
|
||||
RotationAnimation {
|
||||
target: wifiPreferenceIcon
|
||||
property: "rotation"
|
||||
running: networkTab.changingNetworkPreference
|
||||
running: NetworkService.changingPreference
|
||||
from: 0
|
||||
to: 360
|
||||
duration: 1000
|
||||
@@ -386,7 +386,7 @@ Item {
|
||||
}
|
||||
|
||||
Text {
|
||||
text: NetworkService.changingNetworkPreference ? "Switching..." : "Prefer over Ethernet"
|
||||
text: NetworkService.changingPreference ? "Switching..." : "Prefer over Ethernet"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: NetworkService.networkStatus === "wifi" ? Theme.background : Theme.primary
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -400,7 +400,7 @@ Item {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
propagateComposedEvents: false
|
||||
enabled: !networkTab.changingNetworkPreference
|
||||
enabled: !NetworkService.changingPreference
|
||||
onClicked: {
|
||||
console.log("Force WiFi preference clicked");
|
||||
if (NetworkService.networkStatus !== "wifi")
|
||||
|
||||
@@ -373,78 +373,41 @@ PanelWindow {
|
||||
border.width: 1
|
||||
clip: true
|
||||
|
||||
readonly property bool hasNotificationImage: modelData.latestNotification.image && modelData.latestNotification.image !== ""
|
||||
|
||||
IconImage {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 6
|
||||
anchors.margins: 2
|
||||
source: {
|
||||
// Don't try to load icons for screenshots - let fallback handle them
|
||||
const isScreenshot = modelData.latestNotification.isScreenshot;
|
||||
|
||||
if (isScreenshot) {
|
||||
return "";
|
||||
// Priority 1: Use notification image if available
|
||||
if (parent.hasNotificationImage) {
|
||||
return modelData.latestNotification.cleanImage;
|
||||
}
|
||||
|
||||
if (modelData.latestNotification.appIcon && modelData.latestNotification.appIcon !== "")
|
||||
return Quickshell.iconPath(modelData.latestNotification.appIcon, "");
|
||||
// Priority 2: Use appIcon - handle URLs directly, use iconPath for icon names
|
||||
if (modelData.latestNotification.appIcon) {
|
||||
const appIcon = modelData.latestNotification.appIcon;
|
||||
if (appIcon.startsWith("file://") || appIcon.startsWith("http://") || appIcon.startsWith("https://")) {
|
||||
return appIcon;
|
||||
}
|
||||
return Quickshell.iconPath(appIcon, "");
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
visible: status === Image.Ready
|
||||
onStatusChanged: {
|
||||
if (status === Image.Error || status === Image.Null || source === "")
|
||||
fallbackIcon.visible = true;
|
||||
else if (status === Image.Ready)
|
||||
fallbackIcon.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: fallbackIcon
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: true
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
readonly property bool isScreenshot: modelData.latestNotification.isScreenshot
|
||||
readonly property bool hasNotificationImage: modelData.latestNotification.image && modelData.latestNotification.image !== ""
|
||||
|
||||
// Priority 1: Notification image using Quickshell IconImage
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 2
|
||||
radius: 20
|
||||
clip: true
|
||||
visible: parent.hasNotificationImage && centerNotificationImage.status === Image.Ready
|
||||
color: "transparent"
|
||||
|
||||
IconImage {
|
||||
id: centerNotificationImage
|
||||
anchors.fill: parent
|
||||
source: modelData.latestNotification.image || ""
|
||||
}
|
||||
}
|
||||
|
||||
// Priority 2: Material Symbols icon for screenshots without notification images
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "screenshot_monitor"
|
||||
size: 20
|
||||
color: Theme.primaryText
|
||||
visible: parent.isScreenshot && !parent.hasNotificationImage
|
||||
}
|
||||
|
||||
// Priority 3: Fallback to first letter for other notifications
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: !parent.hasNotificationImage && !parent.isScreenshot
|
||||
text: {
|
||||
const appName = modelData.appName || "?";
|
||||
return appName.charAt(0).toUpperCase();
|
||||
}
|
||||
font.pixelSize: 20
|
||||
font.weight: Font.Bold
|
||||
color: Theme.primaryText
|
||||
visible: !parent.hasNotificationImage && (!modelData.latestNotification.appIcon || modelData.latestNotification.appIcon === "")
|
||||
text: {
|
||||
const appName = modelData.appName || "?";
|
||||
return appName.charAt(0).toUpperCase();
|
||||
}
|
||||
font.pixelSize: 20
|
||||
font.weight: Font.Bold
|
||||
color: Theme.primaryText
|
||||
}
|
||||
|
||||
}
|
||||
@@ -828,35 +791,32 @@ PanelWindow {
|
||||
|
||||
readonly property bool hasNotificationImage: modelData.image && modelData.image !== ""
|
||||
|
||||
// Priority 1: Notification image using Quickshell IconImage
|
||||
Rectangle {
|
||||
IconImage {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 1
|
||||
radius: 14
|
||||
clip: true
|
||||
visible: parent.hasNotificationImage && centerIndividualNotificationImage.status === Image.Ready
|
||||
color: "transparent"
|
||||
source: {
|
||||
// Priority 1: Use notification image if available
|
||||
if (parent.hasNotificationImage) {
|
||||
return modelData.cleanImage;
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: centerIndividualNotificationImage
|
||||
anchors.fill: parent
|
||||
source: modelData.image || ""
|
||||
// Priority 2: Use appIcon - handle URLs directly, use iconPath for icon names
|
||||
if (modelData.appIcon) {
|
||||
const appIcon = modelData.appIcon;
|
||||
if (appIcon.startsWith("file://") || appIcon.startsWith("http://") || appIcon.startsWith("https://")) {
|
||||
return appIcon;
|
||||
}
|
||||
return Quickshell.iconPath(appIcon, "");
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
visible: status === Image.Ready
|
||||
}
|
||||
|
||||
// Priority 2: Material Symbols icon for screenshots without notification images
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "screenshot_monitor"
|
||||
size: 12
|
||||
color: Theme.primaryText
|
||||
visible: modelData.isScreenshot && !parent.hasNotificationImage
|
||||
}
|
||||
|
||||
// Priority 3: Fallback text
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: !parent.hasNotificationImage && !modelData.isScreenshot
|
||||
visible: !parent.hasNotificationImage && (!modelData.appIcon || modelData.appIcon === "")
|
||||
text: {
|
||||
const appName = modelData.appName || "?";
|
||||
return appName.charAt(0).toUpperCase();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -79,7 +79,7 @@ PanelWindow {
|
||||
Scale {
|
||||
id: scaleTransform
|
||||
|
||||
origin.x: parent.width * 0.85 // Scale from top-right
|
||||
origin.x: dropdownContent.width * 0.85 // Scale from top-right
|
||||
origin.y: 0
|
||||
xScale: processListDropdown.isVisible ? 1 : 0.95
|
||||
yScale: processListDropdown.isVisible ? 1 : 0.8
|
||||
|
||||
@@ -239,6 +239,7 @@ PanelWindow {
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AppSearchService
|
||||
function onReadyChanged() {
|
||||
if (AppSearchService.ready) {
|
||||
var allCategories = AppSearchService.getAllCategories().filter((cat) => {
|
||||
@@ -254,11 +255,10 @@ PanelWindow {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
target: DesktopEntries
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: AppSearchService
|
||||
function onApplicationsChanged() {
|
||||
console.log("SpotlightLauncher: DesktopEntries.applicationsChanged signal received");
|
||||
// Update categories when applications change
|
||||
@@ -278,8 +278,6 @@ PanelWindow {
|
||||
console.log("SpotlightLauncher: AppSearchService not ready, skipping update");
|
||||
}
|
||||
}
|
||||
|
||||
target: DesktopEntries
|
||||
}
|
||||
|
||||
// Dimmed overlay background
|
||||
|
||||
@@ -134,7 +134,7 @@ PanelWindow {
|
||||
|
||||
LauncherButton {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
isActive: launcher.isVisible
|
||||
isActive: appLauncher.isVisible
|
||||
onClicked: {
|
||||
appLauncher.toggle();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,14 @@ Singleton {
|
||||
inlineReplySupported: true
|
||||
|
||||
onNotification: notif => {
|
||||
console.log("New notification received:", notif.appName, "-", notif.summary);
|
||||
console.log("=== RAW NOTIFICATION DATA ===");
|
||||
console.log("appName:", notif.appName);
|
||||
console.log("summary:", notif.summary);
|
||||
console.log("body:", notif.body);
|
||||
console.log("appIcon:", notif.appIcon);
|
||||
console.log("image:", notif.image);
|
||||
console.log("urgency:", notif.urgency);
|
||||
console.log("=============================");
|
||||
notif.tracked = true;
|
||||
|
||||
const wrapper = notifComponent.createObject(root, {
|
||||
@@ -70,35 +77,32 @@ Singleton {
|
||||
readonly property string summary: notification.summary
|
||||
readonly property string body: notification.body
|
||||
readonly property string appIcon: notification.appIcon
|
||||
readonly property string cleanAppIcon: {
|
||||
if (!appIcon) return "";
|
||||
if (appIcon.startsWith("file://")) {
|
||||
return appIcon.substring(7);
|
||||
}
|
||||
return appIcon;
|
||||
}
|
||||
readonly property string appName: notification.appName
|
||||
readonly property string image: notification.image
|
||||
readonly property string cleanImage: {
|
||||
if (!image) return "";
|
||||
if (image.startsWith("file://")) {
|
||||
return image.substring(7);
|
||||
}
|
||||
return image;
|
||||
}
|
||||
readonly property int urgency: notification.urgency
|
||||
readonly property list<NotificationAction> actions: notification.actions
|
||||
|
||||
// Enhanced properties for better handling
|
||||
readonly property bool hasImage: image && image.length > 0
|
||||
readonly property bool hasAppIcon: appIcon && appIcon.length > 0
|
||||
readonly property bool isConversation: detectIsConversation()
|
||||
readonly property bool isConversation: notification.hasInlineReply
|
||||
readonly property bool isMedia: detectIsMedia()
|
||||
readonly property bool isSystem: detectIsSystem()
|
||||
readonly property bool isScreenshot: detectIsScreenshot()
|
||||
|
||||
function detectIsConversation() {
|
||||
const appNameLower = appName.toLowerCase();
|
||||
const summaryLower = summary.toLowerCase();
|
||||
const bodyLower = body.toLowerCase();
|
||||
|
||||
return appNameLower.includes("discord") ||
|
||||
appNameLower.includes("vesktop") ||
|
||||
appNameLower.includes("vencord") ||
|
||||
appNameLower.includes("telegram") ||
|
||||
appNameLower.includes("whatsapp") ||
|
||||
appNameLower.includes("signal") ||
|
||||
appNameLower.includes("slack") ||
|
||||
appNameLower.includes("message") ||
|
||||
summaryLower.includes("message") ||
|
||||
bodyLower.includes("message");
|
||||
}
|
||||
|
||||
function detectIsMedia() {
|
||||
const appNameLower = appName.toLowerCase();
|
||||
@@ -123,24 +127,6 @@ Singleton {
|
||||
summaryLower.includes("system");
|
||||
}
|
||||
|
||||
function detectIsScreenshot() {
|
||||
const appNameLower = appName.toLowerCase();
|
||||
const summaryLower = summary.toLowerCase();
|
||||
const bodyLower = body.toLowerCase();
|
||||
const imageLower = image.toLowerCase();
|
||||
|
||||
// Detect niri screenshot notifications
|
||||
return appNameLower.includes("niri") &&
|
||||
(summaryLower.includes("screenshot") ||
|
||||
bodyLower.includes("screenshot") ||
|
||||
imageLower.includes("screenshot") ||
|
||||
imageLower.includes("pictures/screenshots")) ||
|
||||
summaryLower.includes("screenshot") ||
|
||||
bodyLower.includes("screenshot taken") ||
|
||||
// Detect screenshot file paths being used as images/icons
|
||||
imageLower.includes("/screenshots/") ||
|
||||
imageLower.includes("screenshot from");
|
||||
}
|
||||
|
||||
readonly property Timer timer: Timer {
|
||||
running: wrapper.popup
|
||||
@@ -184,114 +170,32 @@ Singleton {
|
||||
wrapper.notification.dismiss();
|
||||
}
|
||||
|
||||
function getNotificationIcon(wrapper) {
|
||||
// Priority 1: Use notification image if available (Discord avatars, etc.)
|
||||
// BUT NOT for screenshots - they use file paths which shouldn't be loaded as icons
|
||||
if (wrapper.hasImage && !wrapper.isScreenshot) {
|
||||
return wrapper.image;
|
||||
}
|
||||
|
||||
// Priority 2: Use app icon if available and not a screenshot
|
||||
if (wrapper.hasAppIcon && !wrapper.isScreenshot) {
|
||||
return Quickshell.iconPath(wrapper.appIcon, "image-missing");
|
||||
}
|
||||
|
||||
// Priority 3: Generate fallback icon based on type
|
||||
return getFallbackIcon(wrapper);
|
||||
}
|
||||
|
||||
function getFallbackIcon(wrapper) {
|
||||
if (wrapper.isScreenshot) {
|
||||
return Quickshell.iconPath("screenshot_monitor");
|
||||
} else if (wrapper.isConversation) {
|
||||
return Quickshell.iconPath("chat-symbolic");
|
||||
} else if (wrapper.isMedia) {
|
||||
return Quickshell.iconPath("audio-x-generic-symbolic");
|
||||
} else if (wrapper.isSystem) {
|
||||
return Quickshell.iconPath("preferences-system-symbolic");
|
||||
}
|
||||
return Quickshell.iconPath("application-x-executable-symbolic");
|
||||
}
|
||||
|
||||
function getAppIconPath(wrapper) {
|
||||
if (wrapper.hasAppIcon && !wrapper.isScreenshot) {
|
||||
return Quickshell.iconPath(wrapper.appIcon);
|
||||
}
|
||||
return getFallbackIcon(wrapper);
|
||||
}
|
||||
|
||||
// Android 16-style notification grouping functions
|
||||
function getGroupKey(wrapper) {
|
||||
const appName = wrapper.appName.toLowerCase();
|
||||
|
||||
// Enhanced grouping for conversation apps
|
||||
// Conversation apps with inline reply
|
||||
if (wrapper.isConversation) {
|
||||
const summary = wrapper.summary.toLowerCase();
|
||||
const body = wrapper.body.toLowerCase();
|
||||
|
||||
// Discord: Group by channel or conversation
|
||||
if (appName.includes("discord") || appName.includes("vesktop")) {
|
||||
// Channel notifications: "#general", "#announcements"
|
||||
if (summary.includes("#")) {
|
||||
const channelMatch = summary.match(/#[\w-]+/);
|
||||
if (channelMatch) {
|
||||
return `${appName}:${channelMatch[0]}`;
|
||||
}
|
||||
// Group by conversation/channel name from summary
|
||||
if (summary.includes("#")) {
|
||||
const channelMatch = summary.match(/#[\w-]+/);
|
||||
if (channelMatch) {
|
||||
return `${appName}:${channelMatch[0]}`;
|
||||
}
|
||||
// Direct messages: group by sender
|
||||
if (summary && !summary.includes("new message") && !summary.includes("notification")) {
|
||||
return `${appName}:dm:${summary}`;
|
||||
}
|
||||
// Server messages or general
|
||||
return `${appName}:messages`;
|
||||
}
|
||||
|
||||
// Telegram: Group by chat/channel
|
||||
if (appName.includes("telegram")) {
|
||||
if (summary && !summary.includes("new message")) {
|
||||
return `${appName}:${summary}`;
|
||||
}
|
||||
return `${appName}:messages`;
|
||||
}
|
||||
|
||||
// Signal: Group by conversation
|
||||
if (appName.includes("signal")) {
|
||||
if (summary && !summary.includes("new message")) {
|
||||
return `${appName}:${summary}`;
|
||||
}
|
||||
return `${appName}:messages`;
|
||||
}
|
||||
|
||||
// WhatsApp: Group by contact/group
|
||||
if (appName.includes("whatsapp")) {
|
||||
if (summary && !summary.includes("new message")) {
|
||||
return `${appName}:${summary}`;
|
||||
}
|
||||
return `${appName}:messages`;
|
||||
}
|
||||
|
||||
// Slack: Group by channel/DM
|
||||
if (appName.includes("slack")) {
|
||||
if (summary.includes("#")) {
|
||||
const channelMatch = summary.match(/#[\w-]+/);
|
||||
if (channelMatch) {
|
||||
return `${appName}:${channelMatch[0]}`;
|
||||
}
|
||||
}
|
||||
if (summary && !summary.includes("new message")) {
|
||||
return `${appName}:dm:${summary}`;
|
||||
}
|
||||
return `${appName}:messages`;
|
||||
// Group by sender/conversation name if meaningful
|
||||
if (summary && !summary.includes("new message") && !summary.includes("notification")) {
|
||||
return `${appName}:${summary}`;
|
||||
}
|
||||
|
||||
// Default conversation grouping
|
||||
return `${appName}:conversation`;
|
||||
}
|
||||
|
||||
// Screenshots: Group all screenshots together
|
||||
if (wrapper.isScreenshot) {
|
||||
return "screenshots";
|
||||
}
|
||||
|
||||
// Media: Replace previous media notification from same app
|
||||
if (wrapper.isMedia) {
|
||||
@@ -332,8 +236,7 @@ Singleton {
|
||||
hasInlineReply: false,
|
||||
isConversation: notif.isConversation,
|
||||
isMedia: notif.isMedia,
|
||||
isSystem: notif.isSystem,
|
||||
isScreenshot: notif.isScreenshot
|
||||
isSystem: notif.isSystem
|
||||
};
|
||||
}
|
||||
|
||||
@@ -366,8 +269,7 @@ Singleton {
|
||||
hasInlineReply: false,
|
||||
isConversation: notif.isConversation,
|
||||
isMedia: notif.isMedia,
|
||||
isSystem: notif.isSystem,
|
||||
isScreenshot: notif.isScreenshot
|
||||
isSystem: notif.isSystem
|
||||
};
|
||||
}
|
||||
|
||||
@@ -419,17 +321,10 @@ Singleton {
|
||||
}
|
||||
|
||||
if (group.isConversation) {
|
||||
// Extract conversation/channel name from group key
|
||||
const keyParts = group.key.split(":");
|
||||
if (keyParts.length > 1) {
|
||||
const conversationKey = keyParts[keyParts.length - 1];
|
||||
if (conversationKey.startsWith("#")) {
|
||||
return `${conversationKey}: ${group.count} messages`;
|
||||
}
|
||||
if (keyParts.includes("dm")) {
|
||||
return `${conversationKey}: ${group.count} messages`;
|
||||
}
|
||||
if (conversationKey !== "messages" && conversationKey !== "conversation") {
|
||||
if (conversationKey !== "conversation") {
|
||||
return `${conversationKey}: ${group.count} messages`;
|
||||
}
|
||||
}
|
||||
@@ -440,12 +335,6 @@ Singleton {
|
||||
return "Now playing";
|
||||
}
|
||||
|
||||
if (group.isScreenshot) {
|
||||
if (group.count === 1) {
|
||||
return "Screenshot saved";
|
||||
}
|
||||
return `${group.count} screenshots saved`;
|
||||
}
|
||||
|
||||
if (group.isSystem) {
|
||||
const keyParts = group.key.split(":");
|
||||
@@ -481,9 +370,6 @@ Singleton {
|
||||
return group.latestNotification.body || "Media playback";
|
||||
}
|
||||
|
||||
if (group.isScreenshot) {
|
||||
return group.latestNotification.body || "Screenshot available in Pictures/Screenshots";
|
||||
}
|
||||
|
||||
return `Latest: ${group.latestNotification.summary}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user