remove authorColor unused in Session

This commit is contained in:
Audric Ackermann 2020-09-15 15:24:57 +10:00
parent 6eb13e43e3
commit 56cd42d34c
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
24 changed files with 7 additions and 74 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

View File

@ -73,7 +73,6 @@
'folder-outline.svg',
'forward.svg',
'gear.svg',
'group_default.png',
'hourglass_empty.svg',
'hourglass_full.svg',
'icon_1024.png',
@ -731,7 +730,6 @@
profileName: displayName,
pubkey: ourNumber,
avatarPath,
avatarColor: conversation.getColor(),
onOk: async (newName, avatar) => {
let newAvatarPath = '';
let url = null;
@ -1065,7 +1063,6 @@
profileName: displayName,
pubkey: userPubKey,
avatarPath,
avatarColor: conversation.getColor(),
isRss: conversation.isRss(),
onStartConversation: () => {
Whisper.events.trigger('showConversation', userPubKey);

View File

@ -32,7 +32,6 @@
UNRESTRICTED: 3,
};
const { Util } = window.Signal;
const {
Conversation,
Contact,
@ -571,7 +570,6 @@
getProps() {
const { format } = PhoneNumber;
const regionCode = storage.get('regionCode');
const color = this.getColor();
const typingKeys = Object.keys(this.contactTypingTimers || {});
const result = {
@ -579,7 +577,6 @@
isArchived: this.get('isArchived'),
activeAt: this.get('active_at'),
avatarPath: this.getAvatarPath(),
color,
type: this.isPrivate() ? 'direct' : 'group',
isMe: this.isMe(),
isPublic: this.isPublic(),
@ -2526,14 +2523,6 @@
return this.get('type') === 'private';
},
getColor() {
if (!this.isPrivate()) {
return 'signal-blue';
}
const { migrateColor } = Util;
return migrateColor(this.get('color'));
},
getAvatarPath() {
const avatar = this.get('avatar') || this.get('profileAvatar');
@ -2549,19 +2538,17 @@
},
getAvatar() {
const title = this.get('name');
const color = this.getColor();
const url = this.getAvatarPath();
if (url) {
return { url, color };
return { url };
} else if (this.isPrivate()) {
const symbol = this.isValid() ? '#' : '!';
return {
color,
content: this.getInitials(title) || symbol,
};
}
return { url: 'images/group_default.png', color };
return { url: null };
},
getNotificationIcon() {

View File

@ -414,7 +414,6 @@
const regionCode = storage.get('regionCode');
const contactModel = this.findContact(phoneNumber);
const color = contactModel ? contactModel.getColor() : null;
let profileName;
if (phoneNumber === window.storage.get('primaryDevicePubKey')) {
profileName = i18n('you');
@ -426,7 +425,7 @@
phoneNumber: format(phoneNumber, {
ourRegionCode: regionCode,
}),
color,
color: null,
avatarPath: contactModel ? contactModel.getAvatarPath() : null,
name: contactModel ? contactModel.getName() : null,
profileName,
@ -565,7 +564,6 @@
const contact = this.findAndFormatContact(phoneNumber);
const contactModel = this.findContact(phoneNumber);
const authorColor = contactModel ? contactModel.getColor() : null;
const authorAvatarPath = contactModel
? contactModel.getAvatarPath()
: null;
@ -599,7 +597,6 @@
serverTimestamp: this.get('serverTimestamp'),
status: this.getMessagePropStatus(),
contact: this.getPropsForEmbeddedContact(),
authorColor,
authorName: contact.name,
authorProfileName: contact.profileName,
authorPhoneNumber: contact.phoneNumber,
@ -764,7 +761,6 @@
const { author, id, referencedMessageNotFound } = quote;
const contact = author && ConversationController.get(author);
const authorColor = contact ? contact.getColor() : 'grey';
const authorPhoneNumber = format(author, {
ourRegionCode: regionCode,
@ -794,7 +790,6 @@
authorPhoneNumber,
authorProfileName,
authorName,
authorColor,
onClick,
referencedMessageNotFound,
};

View File

@ -1424,7 +1424,7 @@ class LokiPublicChannelAPI {
value: {
name: 'Your Public Chat',
description: 'Your public chat room',
avatar: 'images/group_default.png',
avatar: null,
},
},
];

View File

@ -32,7 +32,6 @@
Component: window.Signal.Components.ContactListItem,
props: {
isMe,
color: this.model.getColor(),
avatarPath: this.model.getAvatarPath(),
phoneNumber: this.model.getNumber(),
name: this.model.getName(),

View File

@ -165,7 +165,6 @@
name: this.model.getName(),
phoneNumber: this.model.getNumber(),
profileName: this.model.getProfileName(),
color: this.model.getColor(),
avatarPath: this.model.getAvatarPath(),
isVerified: this.model.isVerified(),
isMe: this.model.isMe(),
@ -279,7 +278,6 @@
name: this.model.getName(),
phoneNumber: this.model.getNumber(),
profileName: this.model.getProfileName(),
color: this.model.getColor(),
avatarPath: this.model.getAvatarPath(),
isGroup: !this.model.isPrivate(),
isPublic: this.model.isPublic(),

View File

@ -8,21 +8,13 @@
Whisper.EditProfileDialogView = Whisper.View.extend({
className: 'loki-dialog modal',
initialize({
profileName,
avatarPath,
avatarColor,
pubkey,
onOk,
callback,
}) {
initialize({ profileName, avatarPath, pubkey, onOk, callback }) {
this.close = this.close.bind(this);
this.callback = callback;
this.profileName = profileName;
this.pubkey = pubkey;
this.avatarPath = avatarPath;
this.avatarColor = avatarColor;
this.onOk = onOk;
this.$el.focus();

View File

@ -11,7 +11,6 @@
initialize({
profileName,
avatarPath,
avatarColor,
pubkey,
isRss,
onOk,
@ -23,7 +22,6 @@
this.pubkey = pubkey;
this.isRss = isRss;
this.avatarPath = avatarPath;
this.avatarColor = avatarColor;
this.onOk = onOk;
this.onStartConversation = onStartConversation;

View File

@ -86,11 +86,8 @@ export class Avatar extends React.PureComponent<Props, State> {
/>
);
}
console.warn(
'renderNoImage should not happen with something else than a closed group'
);
return <div className={classNames('module-avatar__icon')} />;
return this.renderIdenticon();
}
public render() {
@ -121,7 +118,7 @@ export class Avatar extends React.PureComponent<Props, State> {
}}
role="button"
>
{hasImage ? this.renderAvatarOrIdenticon() : this.renderNoImage()}
{hasImage ? this.renderImage() : this.renderNoImage()}
</div>
);
}
@ -133,12 +130,6 @@ export class Avatar extends React.PureComponent<Props, State> {
}
}
private renderAvatarOrIdenticon() {
const { avatarPath } = this.props;
return avatarPath ? this.renderImage() : this.renderIdenticon();
}
private getAvatarColors(): Array<string> {
// const theme = window.Events.getThemedSettings();
// defined in session-android as `profile_picture_placeholder_colors`

View File

@ -10,7 +10,6 @@ interface Props {
phoneNumber: string;
isMe?: boolean;
name?: string;
color: string;
verified: boolean;
profileName?: string;
avatarPath?: string;

View File

@ -30,7 +30,6 @@ interface Props {
i18n: any;
profileName: string;
avatarPath: string;
avatarColor: string;
pubkey: string;
onClose: any;
onOk: any;

View File

@ -14,7 +14,6 @@ interface Props {
isRss: boolean;
profileName: string;
avatarPath: string;
avatarColor: string; //fixme audric toremove
pubkey: string;
onClose: any;
onStartConversation: any;

View File

@ -50,7 +50,6 @@ export class CreateGroupDialog extends React.Component<Props, State> {
authorProfileName: name,
selected: false,
authorName: name, // different from ProfileName?
authorColor: d.getColor(),
checkmarked: false,
};
});

View File

@ -45,7 +45,6 @@ export class InviteContactsDialog extends React.Component<Props, State> {
authorAvatarPath: d?.cachedProps?.avatarPath,
selected: false,
authorName: name,
authorColor: d.getColor(),
checkmarked: false,
existingMember,
};

View File

@ -8,7 +8,6 @@ export interface Contact {
authorProfileName: string;
authorPhoneNumber: string;
authorName: string;
authorColor: any;
authorAvatarPath: string;
checkmarked: boolean;
existingMember: boolean;

View File

@ -78,7 +78,6 @@ export interface Props {
authorProfileName?: string;
/** Note: this should be formatted for display */
authorPhoneNumber: string;
authorColor?: ColorType;
conversationType: 'group' | 'direct';
attachments?: Array<AttachmentType>;
quote?: {
@ -88,7 +87,6 @@ export interface Props {
authorPhoneNumber: string;
authorProfileName?: string;
authorName?: string;
authorColor?: ColorType;
onClick?: () => void;
referencedMessageNotFound: boolean;
};
@ -585,7 +583,6 @@ export class Message extends React.PureComponent<Props, State> {
public renderQuote() {
const {
conversationType,
authorColor,
direction,
i18n,
quote,
@ -599,8 +596,6 @@ export class Message extends React.PureComponent<Props, State> {
const withContentAbove =
conversationType === 'group' && direction === 'incoming';
const quoteColor =
direction === 'incoming' ? authorColor : quote.authorColor;
const shortenedPubkey = window.shortenPubkey(quote.authorPhoneNumber);
@ -621,7 +616,6 @@ export class Message extends React.PureComponent<Props, State> {
authorPhoneNumber={displayedPubkey}
authorProfileName={quote.authorProfileName}
authorName={quote.authorName}
authorColor={quoteColor}
referencedMessageNotFound={quote.referencedMessageNotFound}
isFromMe={quote.isFromMe}
withContentAbove={withContentAbove}
@ -668,7 +662,6 @@ export class Message extends React.PureComponent<Props, State> {
authorProfileName,
collapseMetadata,
senderIsModerator,
authorColor,
conversationType,
direction,
i18n,
@ -1052,7 +1045,6 @@ export class Message extends React.PureComponent<Props, State> {
public render() {
const {
authorPhoneNumber,
authorColor,
direction,
id,
isKickedFromGroup,

View File

@ -51,7 +51,6 @@ export class AddModeratorsDialog extends React.Component<Props, State> {
authorProfileName: name,
selected: false,
authorName: name,
authorColor: d.getColor(),
checkmarked: false,
existingMember,
};
@ -97,7 +96,6 @@ export class AddModeratorsDialog extends React.Component<Props, State> {
authorAvatarPath: '',
selected: true,
authorName: this.state.inputBoxValue,
authorColor: '#000000',
checkmarked: true,
existingMember: false,
});

View File

@ -34,7 +34,6 @@ export class RemoveModeratorsDialog extends React.Component<Props, State> {
const lokiProfile = d.getLokiProfile();
name = lokiProfile ? lokiProfile.displayName : 'Anonymous';
}
const authorColor = d.getColor ? d.getColor() : '#000000';
// TODO: should take existing members into account
const existingMember = false;
@ -44,7 +43,6 @@ export class RemoveModeratorsDialog extends React.Component<Props, State> {
authorProfileName: name,
selected: false,
authorName: name,
authorColor,
checkmarked: true,
existingMember,
};

View File

@ -15,7 +15,6 @@ interface Props {
authorPhoneNumber: string;
authorProfileName?: string;
authorName?: string;
authorColor?: ColorType;
i18n: LocalizerType;
isFromMe: boolean;
isIncoming: boolean;
@ -365,7 +364,6 @@ export class Quote extends React.Component<Props, State> {
public render() {
const {
authorColor,
isIncoming,
onClick,
referencedMessageNotFound,

View File

@ -52,7 +52,6 @@ export class UpdateGroupMembersDialog extends React.Component<Props, State> {
authorAvatarPath: d?.cachedProps?.avatarPath,
selected: false,
authorName: name, // different from ProfileName?
authorColor: d.getColor(),
checkmarked: false,
existingMember,
};

View File

@ -122,7 +122,6 @@ export class ActionsPanel extends React.Component<Props, State> {
onSelect?: (event: SectionType) => void;
type: SectionType;
avatarPath?: string;
avatarColor?: string;
notificationCount?: number;
}) => {
const handleClick = onSelect

View File

@ -95,7 +95,6 @@ export class SessionClosableOverlay extends React.Component<Props, State> {
authorAvatarPath: d.avatarPath,
selected: false,
authorName: name,
authorColor: d.color,
checkmarked: false,
existingMember,
};

View File

@ -10,7 +10,6 @@ export interface ContactType {
authorProfileName: string;
authorPhoneNumber: string;
authorName: string;
authorColor: any;
authorAvatarPath: string;
checkmarked: boolean;
existingMember: boolean;