Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
Browse files Browse the repository at this point in the history
… t3chguy/fix/19530
  • Loading branch information
t3chguy committed Nov 22, 2021
2 parents 41062c6 + e0927f3 commit 7a3914f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion res/css/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $slider-selection-dot-size: 2.4em;

$container-border-width: 8px;

$timeline-image-boarder-radius: 8px;
$timeline-image-border-radius: 8px;
:root {
font-size: 10px;

Expand Down
4 changes: 2 additions & 2 deletions res/css/views/messages/_MImageBody.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

$timeline-image-boarder-radius: 8px;
$timeline-image-border-radius: 8px;

.mx_MImageBody_thumbnail--blurhash {
position: absolute;
Expand All @@ -25,7 +25,7 @@ $timeline-image-boarder-radius: 8px;

.mx_MImageBody_thumbnail {
object-fit: contain;
border-radius: $timeline-image-boarder-radius;
border-radius: $timeline-image-border-radius;

display: flex;
justify-content: center;
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/messages/_MVideoBody.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ span.mx_MVideoBody {
video.mx_MVideoBody {
max-width: 100%;
height: auto;
border-radius: $timeline-image-boarder-radius;
border-radius: $timeline-image-border-radius;
}
}
18 changes: 8 additions & 10 deletions src/RoomNotifs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
import { MatrixClientPeg } from './MatrixClientPeg';
import { PushProcessor } from 'matrix-js-sdk/src/pushprocessor';
import { NotificationCountType, Room } from "matrix-js-sdk/src/models/room";
import { IAnnotatedPushRule, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules";
import { ConditionKind, IPushRule, PushRuleActionName, PushRuleKind } from "matrix-js-sdk/src/@types/PushRules";

export enum RoomNotifState {
AllMessagesLoud = 'all_messages_loud',
Expand Down Expand Up @@ -205,14 +205,12 @@ function setRoomNotifsStateUnmuted(roomId: string, newState: RoomNotifState): Pr
return Promise.all(promises);
}

function findOverrideMuteRule(roomId: string): IAnnotatedPushRule {
function findOverrideMuteRule(roomId: string): IPushRule {
const cli = MatrixClientPeg.get();
if (!cli.pushRules ||
!cli.pushRules['global'] ||
!cli.pushRules['global'].override) {
if (!cli?.pushRules?.global?.override) {
return null;
}
for (const rule of cli.pushRules['global'].override) {
for (const rule of cli.pushRules.global.override) {
if (isRuleForRoom(roomId, rule)) {
if (isMuteRule(rule) && rule.enabled) {
return rule;
Expand All @@ -222,14 +220,14 @@ function findOverrideMuteRule(roomId: string): IAnnotatedPushRule {
return null;
}

function isRuleForRoom(roomId: string, rule: IAnnotatedPushRule): boolean {
function isRuleForRoom(roomId: string, rule: IPushRule): boolean {
if (rule.conditions.length !== 1) {
return false;
}
const cond = rule.conditions[0];
return (cond.kind === 'event_match' && cond.key === 'room_id' && cond.pattern === roomId);
return (cond.kind === ConditionKind.EventMatch && cond.key === 'room_id' && cond.pattern === roomId);
}

function isMuteRule(rule: IAnnotatedPushRule): boolean {
return (rule.actions.length === 1 && rule.actions[0] === 'dont_notify');
function isMuteRule(rule: IPushRule): boolean {
return (rule.actions.length === 1 && rule.actions[0] === PushRuleActionName.DontNotify);
}
2 changes: 1 addition & 1 deletion src/components/views/dialogs/IncomingSasDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const PHASE_VERIFIED = 3;
const PHASE_CANCELLED = 4;

interface IProps extends IDialogProps {
verifier: VerificationBase; // TODO types
verifier: VerificationBase;
}

interface IState {
Expand Down
2 changes: 1 addition & 1 deletion src/settings/enums/ImageSize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

const SIZE_LARGE = { w: 480, h: 360 };
const SIZE_LARGE = { w: 800, h: 600 };
const SIZE_NORMAL = { w: 324, h: 220 };

export enum ImageSize {
Expand Down

0 comments on commit 7a3914f

Please sign in to comment.