Don't display muted types in folders
This commit is contained in:
parent
b840841620
commit
198a1074ec
@ -117,7 +117,7 @@ export default class ChatTopbar {
|
||||
});
|
||||
|
||||
// delete button
|
||||
this.menuButtons[this.menuButtons.length - 1].element.firstChild.nodeValue = this.appPeersManager.getDeleteButtonText(this.peerId);
|
||||
this.menuButtons[this.menuButtons.length - 1].element.lastChild.replaceWith(i18n(this.appPeersManager.getDeleteButtonText(this.peerId)));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ import ButtonMenu, { ButtonMenuItemOptions } from "./buttonMenu";
|
||||
import PopupDeleteDialog from "./popups/deleteDialog";
|
||||
import { i18n } from "../lib/langPack";
|
||||
import findUpTag from "../helpers/dom/findUpTag";
|
||||
import appNotificationsManager from "../lib/appManagers/appNotificationsManager";
|
||||
|
||||
export default class DialogsContextMenu {
|
||||
private element: HTMLElement;
|
||||
@ -60,16 +61,14 @@ export default class DialogsContextMenu {
|
||||
text: 'ChatList.Context.Mute',
|
||||
onClick: this.onMuteClick,
|
||||
verify: () => {
|
||||
const isMuted = this.dialog.notify_settings && this.dialog.notify_settings.mute_until > (Date.now() / 1000 | 0);
|
||||
return !isMuted && this.selectedId !== rootScope.myId;
|
||||
return this.selectedId !== rootScope.myId && !appNotificationsManager.isPeerLocalMuted(this.dialog.peerId);
|
||||
}
|
||||
}, {
|
||||
icon: 'unmute',
|
||||
text: 'ChatList.Context.Unmute',
|
||||
onClick: this.onMuteClick,
|
||||
verify: () => {
|
||||
const isMuted = this.dialog.notify_settings && this.dialog.notify_settings.mute_until > (Date.now() / 1000 | 0);
|
||||
return isMuted && this.selectedId !== rootScope.myId;
|
||||
return this.selectedId !== rootScope.myId && appNotificationsManager.isPeerLocalMuted(this.dialog.peerId);
|
||||
}
|
||||
}, {
|
||||
icon: 'archive',
|
||||
|
@ -207,7 +207,7 @@ export class AppMessagesManager {
|
||||
|
||||
constructor() {
|
||||
this.dialogsStorage = new DialogsStorage(this, appChatsManager, appPeersManager, serverTimeManager);
|
||||
this.filtersStorage = new FiltersStorage(appPeersManager, appUsersManager, /* apiManager, */ rootScope);
|
||||
this.filtersStorage = new FiltersStorage(this, appPeersManager, appUsersManager, appNotificationsManager, /* apiManager, */ rootScope);
|
||||
|
||||
rootScope.on('apiUpdate', (e) => {
|
||||
this.handleUpdate(e);
|
||||
|
@ -11,7 +11,8 @@ import type { AppPeersManager } from "../appManagers/appPeersManager";
|
||||
import type { AppUsersManager } from "../appManagers/appUsersManager";
|
||||
//import type { ApiManagerProxy } from "../mtproto/mtprotoworker";
|
||||
import type _rootScope from "../rootScope";
|
||||
import type {Dialog} from '../appManagers/appMessagesManager';
|
||||
import type {AppMessagesManager, Dialog} from '../appManagers/appMessagesManager';
|
||||
import type {AppNotificationsManager} from "../appManagers/appNotificationsManager";
|
||||
import apiManager from "../mtproto/mtprotoworker";
|
||||
import { forEachReverse } from "../../helpers/array";
|
||||
|
||||
@ -29,7 +30,12 @@ export default class FiltersStorage {
|
||||
public filters: {[filterId: string]: MyDialogFilter} = {};
|
||||
public orderIndex = START_ORDER_INDEX;
|
||||
|
||||
constructor(private appPeersManager: AppPeersManager, private appUsersManager: AppUsersManager, /* private apiManager: ApiManagerProxy, */ private rootScope: typeof _rootScope) {
|
||||
constructor(private appMessagesManager: AppMessagesManager,
|
||||
private appPeersManager: AppPeersManager,
|
||||
private appUsersManager: AppUsersManager,
|
||||
private appNotificationsManager: AppNotificationsManager,
|
||||
/* private apiManager: ApiManagerProxy, */
|
||||
private rootScope: typeof _rootScope) {
|
||||
rootScope.on('apiUpdate', (e) => {
|
||||
this.handleUpdate(e);
|
||||
});
|
||||
@ -116,7 +122,7 @@ export default class FiltersStorage {
|
||||
|
||||
// exclude_muted
|
||||
if(pFlags.exclude_muted) {
|
||||
const isMuted = (dialog.notify_settings?.mute_until * 1000) > Date.now();
|
||||
const isMuted = this.appNotificationsManager.isPeerLocalMuted(dialog.peerId);
|
||||
if(isMuted) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user