Skip to content

Commit

Permalink
Merge pull request #3119 from oxen-io/clearnet
Browse files Browse the repository at this point in the history
Session 1.12.4
  • Loading branch information
Bilb authored Jun 24, 2024
2 parents 5921251 + ce30326 commit ab86caf
Show file tree
Hide file tree
Showing 25 changed files with 260 additions and 235 deletions.
1 change: 1 addition & 0 deletions actions/setup_and_build/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

name: 'Setup and build'
description: 'Setup and build Session Desktop'
runs:
Expand Down
2 changes: 2 additions & 0 deletions build/entitlements.mac.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<!-- Mac distribution -->
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.audio-input</key>
Expand Down
4 changes: 4 additions & 0 deletions build/entitlements.mas.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<!-- Mac app store -->
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
Expand Down
2 changes: 1 addition & 1 deletion build/notarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports.default = async function notarizing(context) {
}

const options = {
appBundleId: 'org.getsession.desktop',
appBundleId: 'com.loki-project.messenger-desktop',
appPath: `${appOutDir}/${appName}.app`,
appleId: SIGNING_APPLE_ID,
appleIdPassword: SIGNING_APP_PASSWORD,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "session-desktop",
"productName": "Session",
"description": "Private messaging from your desktop",
"version": "1.12.3",
"version": "1.12.4",
"license": "GPL-3.0",
"author": {
"name": "Oxen Labs",
Expand Down Expand Up @@ -95,7 +95,7 @@
"fs-extra": "9.0.0",
"glob": "7.1.2",
"image-type": "^4.1.0",
"libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.1/libsession_util_nodejs-v0.3.1.tar.gz",
"libsession_util_nodejs": "https://github.com/oxen-io/libsession-util-nodejs/releases/download/v0.3.19/libsession_util_nodejs-v0.3.19.tar.gz",
"libsodium-wrappers-sumo": "^0.7.9",
"linkify-it": "^4.0.1",
"lodash": "^4.17.21",
Expand Down
5 changes: 0 additions & 5 deletions stylesheets/_modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
.module-contact-name__profile-number.italic {
font-style: italic;
}

.module-contact-name.compact {
display: block;
}

// Module: Message

.module-message__error-container {
Expand Down
5 changes: 2 additions & 3 deletions ts/components/conversation/ContactName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ type Props = {
profileName?: string | null;
module?: string;
boldProfileName?: boolean;
compact?: boolean;
shouldShowPubkey: boolean;
};

export const ContactName = (props: Props) => {
const { pubkey, name, profileName, module, boldProfileName, compact, shouldShowPubkey } = props;
const { pubkey, name, profileName, module, boldProfileName, shouldShowPubkey } = props;
const prefix = module || 'module-contact-name';

const convoName = useNicknameOrProfileNameOrShortenedPubkey(pubkey);
Expand All @@ -43,7 +42,7 @@ export const ContactName = (props: Props) => {

return (
<span
className={classNames(prefix, compact && 'compact')}
className={classNames(prefix)}
dir="auto"
data-testid={`${prefix}__profile-name`}
style={{
Expand Down
3 changes: 1 addition & 2 deletions ts/components/conversation/message/message-content/Quote.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames';
import React, { useState } from 'react';
import { noop } from 'lodash';
import React, { useState } from 'react';

import * as MIME from '../../../../types/MIME';
import * as GoogleChrome from '../../../../util/GoogleChrome';
Expand Down Expand Up @@ -291,7 +291,6 @@ const QuoteAuthor = (props: QuoteAuthorProps) => {
pubkey={PubKey.shorten(author)}
name={authorName}
profileName={authorProfileName}
compact={true}
shouldShowPubkey={Boolean(props.showPubkeyForAuthor)}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const QuoteAuthor = (props: QuoteAuthorProps) => {
<ContactName
pubkey={PubKey.shorten(author)}
name={authorName}
compact={true}
shouldShowPubkey={Boolean(authorName && !isMe && isPublic)}
/>
</StyledQuoteAuthor>
Expand Down
23 changes: 16 additions & 7 deletions ts/components/dialog/ReactListModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from '../../state/ducks/modalDialog';
import {
useSelectedIsPublic,
useSelectedWeAreAdmin,
useSelectedWeAreModerator,
} from '../../state/selectors/selectedConversation';
import { SortedReactionList } from '../../types/Reaction';
Expand Down Expand Up @@ -50,6 +51,11 @@ const StyledSendersContainer = styled(Flex)`
padding: 0 16px 16px;
`;

const StyledContactContainer = styled.span`
text-overflow: ellipsis;
overflow: hidden;
`;

const StyledReactionBar = styled(Flex)`
width: 100%;
margin: 12px 0 20px 4px;
Expand Down Expand Up @@ -132,7 +138,7 @@ const ReactionSenders = (props: ReactionSendersProps) => {
justifyContent={'space-between'}
alignItems={'center'}
>
<Flex container={true} alignItems={'center'}>
<Flex container={true} alignItems={'center'} style={{ overflow: 'hidden' }}>
<Avatar
size={AvatarSize.XS}
pubkey={sender}
Expand All @@ -143,11 +149,13 @@ const ReactionSenders = (props: ReactionSendersProps) => {
{sender === me ? (
window.i18n('you')
) : (
<ContactName
pubkey={sender}
module="module-conversation__user"
shouldShowPubkey={false}
/>
<StyledContactContainer>
<ContactName
pubkey={sender}
module="module-conversation__user"
shouldShowPubkey={false}
/>
</StyledContactContainer>
)}
</Flex>
{sender === me && (
Expand Down Expand Up @@ -231,6 +239,7 @@ export const ReactListModal = (props: Props) => {

const msgProps = useMessageReactsPropsById(messageId);
const isPublic = useSelectedIsPublic();
const weAreAdmin = useSelectedWeAreAdmin();
const weAreModerator = useSelectedWeAreModerator();
const me = UserUtils.getOurPubKeyStrFromCache();

Expand Down Expand Up @@ -362,7 +371,7 @@ export const ReactListModal = (props: Props) => {
</>
)}
</p>
{isPublic && weAreModerator && (
{isPublic && (weAreAdmin || weAreModerator) && (
<SessionButton
text={window.i18n('clearAll')}
buttonColor={SessionButtonColor.Danger}
Expand Down
14 changes: 13 additions & 1 deletion ts/components/icon/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,19 @@ export type SessionIconType =

export type SessionIconSize = 'tiny' | 'small' | 'medium' | 'large' | 'huge' | 'huge2' | 'max';

export const icons: Record<string, { path: string; viewBox: string; ratio: number }> = {
export type ClipRule = 'nonzero' | 'evenodd' | 'inherit';
export type FillRule = 'nonzero' | 'evenodd';

type IconProps = {
path: string;
viewBox: string;
ratio: number;
fill?: string;
clipRule?: ClipRule;
fillRule?: FillRule;
};

export const icons: Record<SessionIconType, IconProps> = {
addUser: {
path: 'M8.85,2.17c-1.73,0-3.12,1.4-3.12,3.12s1.4,3.12,3.12,3.12c1.73,0,3.13-1.4,3.13-3.12S10.58,2.17,8.85,2.17z M8.85,0.08c2.88,0,5.21,2.33,5.21,5.21s-2.33,5.21-5.21,5.21s-5.2-2.33-5.2-5.21C3.65,2.42,5.98,0.08,8.85,0.08z M20.83,5.29 c0.54,0,0.98,0.41,1.04,0.93l0.01,0.11v2.08h2.08c0.54,0,0.98,0.41,1.04,0.93v0.12c0,0.54-0.41,0.98-0.93,1.04l-0.11,0.01h-2.08 v2.08c0,0.58-0.47,1.04-1.04,1.04c-0.54,0-0.98-0.41-1.04-0.93l-0.01-0.11v-2.08h-2.08c-0.54,0-0.98-0.41-1.04-0.93l-0.01-0.11 c0-0.54,0.41-0.98,0.93-1.04l0.11-0.01h2.08V6.34C19.79,5.76,20.26,5.29,20.83,5.29z M12.5,12.58c2.8,0,5.09,2.21,5.2,4.99v0.22 v2.08c0,0.58-0.47,1.04-1.04,1.04c-0.54,0-0.98-0.41-1.04-0.93l-0.01-0.11v-2.08c0-1.67-1.3-3.03-2.95-3.12h-0.18H5.21 c-1.67,0-3.03,1.3-3.12,2.95v0.18v2.08c0,0.58-0.47,1.04-1.04,1.04c-0.54,0-0.98-0.41-1.04-0.93L0,19.88V17.8 c0-2.8,2.21-5.09,4.99-5.2h0.22h7.29V12.58z',
viewBox: '0 0 25 21',
Expand Down
54 changes: 31 additions & 23 deletions ts/components/icon/SessionIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import styled, { css, keyframes } from 'styled-components';
import React, { memo } from 'react';
import styled, { css, CSSProperties, keyframes } from 'styled-components';

import { icons, SessionIconSize, SessionIconType } from '.';
import { ClipRule, FillRule } from './Icons';

export type SessionIconProps = {
iconType: SessionIconType;
Expand All @@ -15,6 +16,7 @@ export type SessionIconProps = {
glowStartDelay?: number;
noScale?: boolean;
backgroundColor?: string;
style?: CSSProperties;
dataTestId?: string;
unreadCount?: number;
};
Expand Down Expand Up @@ -55,6 +57,9 @@ type StyledSvgProps = {
noScale?: boolean;
iconColor?: string;
backgroundColor?: string;
fill?: string;
clipRule?: ClipRule;
filleRule?: FillRule;
};

const rotate = keyframes`
Expand Down Expand Up @@ -119,37 +124,28 @@ const animation = (props: {
return undefined;
};

const Svg = React.memo(styled.svg<StyledSvgProps>`
const Svg = memo(styled.svg<StyledSvgProps>`
width: ${props => props.width};
transform: ${props => `rotate(${props.iconRotation}deg)`};
${props => animation(props)};
border-radius: ${props => props.borderRadius};
background-color: ${props =>
props.backgroundColor ? props.backgroundColor : '--button-icon-background-color'};
border-radius: ${props => (props.borderRadius ? props.borderRadius : '')};
props.backgroundColor ? props.backgroundColor : 'var(--button-icon-background-color)'};
filter: ${props => (props.noScale ? `drop-shadow(0px 0px 4px ${props.iconColor})` : '')};
fill: ${props => (props.iconColor ? props.iconColor : '--button-icon-stroke-color')};
fill: ${props => (props.iconColor ? props.iconColor : 'var(--button-icon-stroke-color)')};
padding: ${props => (props.iconPadding ? props.iconPadding : '')};
transition: inherit;
`);

const SessionSvg = (props: {
viewBox: string;
path: string | Array<string>;
width: string | number;
height: string | number;
iconRotation: number;
iconColor?: string;
rotateDuration?: number;
glowDuration?: number;
glowStartDelay?: number;
noScale?: boolean;
borderRadius?: string;
backgroundColor?: string;
iconPadding?: string;
dataTestId?: string;
}) => {
const colorSvg = props.iconColor ? props.iconColor : '--button-icon-stroke-color';
const SessionSvg = (
props: StyledSvgProps & {
viewBox: string;
path: string | Array<string>;
style?: CSSProperties;
dataTestId?: string;
}
) => {
const colorSvg = props.iconColor ? props.iconColor : 'var(--button-icon-stroke-color)';
const pathArray = props.path instanceof Array ? props.path : [props.path];
const propsToPick = {
width: props.width,
Expand All @@ -164,6 +160,10 @@ const SessionSvg = (props: {
backgroundColor: props.backgroundColor,
borderRadius: props.borderRadius,
iconPadding: props.iconPadding,
fill: props.fill,
clipRule: props.clipRule,
fillRule: props.filleRule,
style: props.style,
dataTestId: props.dataTestId,
};

Expand All @@ -187,6 +187,7 @@ export const SessionIcon = (props: SessionIconProps) => {
noScale,
backgroundColor,
iconPadding,
style,
dataTestId,
} = props;
let { iconSize, iconRotation } = props;
Expand All @@ -196,6 +197,9 @@ export const SessionIcon = (props: SessionIconProps) => {
const iconDimensions = getIconDimensionFromIconSize(iconSize);
const iconDef = icons[iconType];
const ratio = iconDef?.ratio || 1;
const fill = iconDef?.fill || undefined;
const clipRule = iconDef?.clipRule || 'nonzero';
const fillRule = iconDef?.fillRule || 'nonzero';

return (
<SessionSvg
Expand All @@ -212,6 +216,10 @@ export const SessionIcon = (props: SessionIconProps) => {
iconColor={iconColor}
backgroundColor={backgroundColor}
iconPadding={iconPadding}
fill={fill}
clipRule={clipRule}
filleRule={fillRule}
style={style}
dataTestId={dataTestId}
/>
);
Expand Down
20 changes: 18 additions & 2 deletions ts/components/leftpane/conversation-list-item/MessageItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,21 @@ function IconMessageStatus({ status }: { status: LastMessageStatusType }) {
const nonErrorIconColor = 'var(--text-secondary-color';
switch (status) {
case 'error':
return <SessionIcon iconColor={'var(--danger-color'} iconType="error" iconSize="tiny" />;
return (
<SessionIcon
iconColor={'var(--danger-color'}
iconType="error"
iconSize="tiny"
style={{ flexShrink: 0 }}
/>
);
case 'read':
return (
<SessionIcon
iconColor={nonErrorIconColor}
iconType="doubleCheckCircleFilled"
iconSize="tiny"
style={{ flexShrink: 0 }}
/>
);
case 'sending':
Expand All @@ -84,10 +92,18 @@ function IconMessageStatus({ status }: { status: LastMessageStatusType }) {
iconColor={nonErrorIconColor}
iconType="sending"
iconSize="tiny"
style={{ flexShrink: 0 }}
/>
);
case 'sent':
return <SessionIcon iconColor={nonErrorIconColor} iconType="circleCheck" iconSize="tiny" />;
return (
<SessionIcon
iconColor={nonErrorIconColor}
iconType="circleCheck"
iconSize="tiny"
style={{ flexShrink: 0 }}
/>
);
case undefined:
return null;
default:
Expand Down
Loading

0 comments on commit ab86caf

Please sign in to comment.