Skip to content

Commit b25100c

Browse files
appearance config - Pin DMs
1 parent f2b4424 commit b25100c

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

info/dev/requests.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ Made by Me
6363
--> Fazer o marcador que separa a lista de amigos da lista de DMs estranhos.
6464
--> Fazer uma configuração se o usuário vai ou não receber notificação de DMs estranhos.
6565

66-
--> Os usuários que madam DM devem ser mostrados na lista de fixados. (Apenas os DMs marcados como da lsita de amigos)
67-
6866
--> Criar filtro para desativar animação de gifs especificas. A gente vai usar a ID e dominio do arquivo para facilitar isso.
6967
(Limite de 600 itens por array) (Opçao alternativa de fazer a animação ser hover)
7068

src/app/organisms/navigation/Sidebar/FeaturedTab.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default function FeaturedTab() {
3333
useNotificationUpdate();
3434

3535
const mx = initMatrix.matrixClient;
36+
const appearance = initMatrix.matrixClient.getAccountData('pony.house.appearance')?.getContent() ?? {};
3637

3738
// Home
3839
function getHomeNoti() {
@@ -67,7 +68,7 @@ export default function FeaturedTab() {
6768
noti.total += childNoti.total;
6869
noti.highlight += childNoti.highlight;
6970

70-
dmsNotification.push([mx.getRoom(roomId), childNoti]);
71+
if (appearance.pinDMmessages !== false) dmsNotification.push([mx.getRoom(roomId), childNoti]);
7172

7273
});
7374

src/app/organisms/settings/pages/Appearance.jsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function AppearanceSection() {
1919
const [, updateState] = useState({});
2020

2121
const [showUserDMstatus, setShowUserStatus] = useState(true);
22+
const [pinDMmessages, setPinDMmessages] = useState(true);
2223
const [isAnimateAvatarsHidden, setAnimateAvatarsHidden] = useState(false);
2324
const [isEmbedDisabled, setEmbedDisabled] = useState(false);
2425
const [isUNhoverDisabled, setUNhoverDisabled] = useState(false);
@@ -31,6 +32,7 @@ function AppearanceSection() {
3132
const content = initMatrix.matrixClient.getAccountData('pony.house.appearance')?.getContent() ?? {};
3233
const zoomApp = Number(global.localStorage.getItem('pony-house-zoom'));
3334

35+
setPinDMmessages((content.pinDMmessages !== false));
3436
setShowUserStatus((content.showUserDMstatus !== false));
3537
setAnimateAvatarsHidden((content.isAnimateAvatarsHidden === true));
3638
setEmbedDisabled((content.isEmbedDisabled === true));
@@ -131,7 +133,9 @@ function AppearanceSection() {
131133

132134
<div className="card noselect mt-3">
133135
<ul className="list-group list-group-flush">
136+
134137
<li className="list-group-item very-small text-gray">Room users</li>
138+
135139
<SettingTile
136140
title="Show user DM status"
137141
options={(
@@ -143,6 +147,19 @@ function AppearanceSection() {
143147
)}
144148
content={<div className="very-small text-gray">All users in your DM will show whether they are online or not.</div>}
145149
/>
150+
151+
<SettingTile
152+
title="Pin DMs on the sidebar"
153+
options={(
154+
<Toggle
155+
className='d-inline-flex'
156+
isActive={pinDMmessages}
157+
onToggle={toggleAction('pony.house.appearance', 'pinDMmessages', setPinDMmessages)}
158+
/>
159+
)}
160+
content={<div className="very-small text-gray">Whenever you receive a new notification in your DM list, you will see a notification icon in the sidebar.</div>}
161+
/>
162+
146163
</ul>
147164
</div>
148165

0 commit comments

Comments
 (0)