diff --git a/images/group_default.png b/images/group_default.png deleted file mode 100644 index 6b503e9ff..000000000 Binary files a/images/group_default.png and /dev/null differ diff --git a/js/background.js b/js/background.js index 094d63fee..567e1d83f 100644 --- a/js/background.js +++ b/js/background.js @@ -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); diff --git a/js/models/conversations.js b/js/models/conversations.js index e2be0e221..87843e33f 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -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() { diff --git a/js/models/messages.js b/js/models/messages.js index 6e444ef22..4da827afc 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -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, }; diff --git a/js/modules/loki_app_dot_net_api.js b/js/modules/loki_app_dot_net_api.js index 4ade77836..c506e87fa 100644 --- a/js/modules/loki_app_dot_net_api.js +++ b/js/modules/loki_app_dot_net_api.js @@ -1424,7 +1424,7 @@ class LokiPublicChannelAPI { value: { name: 'Your Public Chat', description: 'Your public chat room', - avatar: 'images/group_default.png', + avatar: null, }, }, ]; diff --git a/js/views/contact_list_view.js b/js/views/contact_list_view.js index 106598813..631ec390d 100644 --- a/js/views/contact_list_view.js +++ b/js/views/contact_list_view.js @@ -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(), diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 165ac3032..eb57925da 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -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(), diff --git a/js/views/edit_profile_dialog_view.js b/js/views/edit_profile_dialog_view.js index b96eabfec..cb1996753 100644 --- a/js/views/edit_profile_dialog_view.js +++ b/js/views/edit_profile_dialog_view.js @@ -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(); diff --git a/js/views/user_details_dialog_view.js b/js/views/user_details_dialog_view.js index 98c164691..d86340cfb 100644 --- a/js/views/user_details_dialog_view.js +++ b/js/views/user_details_dialog_view.js @@ -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; diff --git a/ts/components/Avatar.tsx b/ts/components/Avatar.tsx index 3c30a6c30..b84c1c202 100644 --- a/ts/components/Avatar.tsx +++ b/ts/components/Avatar.tsx @@ -86,11 +86,8 @@ export class Avatar extends React.PureComponent { /> ); } - console.warn( - 'renderNoImage should not happen with something else than a closed group' - ); - return
; + return this.renderIdenticon(); } public render() { @@ -121,7 +118,7 @@ export class Avatar extends React.PureComponent { }} role="button" > - {hasImage ? this.renderAvatarOrIdenticon() : this.renderNoImage()} + {hasImage ? this.renderImage() : this.renderNoImage()}
); } @@ -133,12 +130,6 @@ export class Avatar extends React.PureComponent { } } - private renderAvatarOrIdenticon() { - const { avatarPath } = this.props; - - return avatarPath ? this.renderImage() : this.renderIdenticon(); - } - private getAvatarColors(): Array { // const theme = window.Events.getThemedSettings(); // defined in session-android as `profile_picture_placeholder_colors` diff --git a/ts/components/ContactListItem.tsx b/ts/components/ContactListItem.tsx index 2796dcb7d..0cf81a6f4 100644 --- a/ts/components/ContactListItem.tsx +++ b/ts/components/ContactListItem.tsx @@ -10,7 +10,6 @@ interface Props { phoneNumber: string; isMe?: boolean; name?: string; - color: string; verified: boolean; profileName?: string; avatarPath?: string; diff --git a/ts/components/EditProfileDialog.tsx b/ts/components/EditProfileDialog.tsx index 11a72966e..065490bcb 100644 --- a/ts/components/EditProfileDialog.tsx +++ b/ts/components/EditProfileDialog.tsx @@ -30,7 +30,6 @@ interface Props { i18n: any; profileName: string; avatarPath: string; - avatarColor: string; pubkey: string; onClose: any; onOk: any; diff --git a/ts/components/UserDetailsDialog.tsx b/ts/components/UserDetailsDialog.tsx index 4b75af776..db566a323 100644 --- a/ts/components/UserDetailsDialog.tsx +++ b/ts/components/UserDetailsDialog.tsx @@ -14,7 +14,6 @@ interface Props { isRss: boolean; profileName: string; avatarPath: string; - avatarColor: string; //fixme audric toremove pubkey: string; onClose: any; onStartConversation: any; diff --git a/ts/components/conversation/CreateGroupDialog.tsx b/ts/components/conversation/CreateGroupDialog.tsx index 3ae0fa1b0..9ea4baa47 100644 --- a/ts/components/conversation/CreateGroupDialog.tsx +++ b/ts/components/conversation/CreateGroupDialog.tsx @@ -50,7 +50,6 @@ export class CreateGroupDialog extends React.Component { authorProfileName: name, selected: false, authorName: name, // different from ProfileName? - authorColor: d.getColor(), checkmarked: false, }; }); diff --git a/ts/components/conversation/InviteContactsDialog.tsx b/ts/components/conversation/InviteContactsDialog.tsx index 871c6f0e8..3268564a3 100644 --- a/ts/components/conversation/InviteContactsDialog.tsx +++ b/ts/components/conversation/InviteContactsDialog.tsx @@ -45,7 +45,6 @@ export class InviteContactsDialog extends React.Component { authorAvatarPath: d?.cachedProps?.avatarPath, selected: false, authorName: name, - authorColor: d.getColor(), checkmarked: false, existingMember, }; diff --git a/ts/components/conversation/MemberList.tsx b/ts/components/conversation/MemberList.tsx index d2121e3a2..0ea697af2 100644 --- a/ts/components/conversation/MemberList.tsx +++ b/ts/components/conversation/MemberList.tsx @@ -8,7 +8,6 @@ export interface Contact { authorProfileName: string; authorPhoneNumber: string; authorName: string; - authorColor: any; authorAvatarPath: string; checkmarked: boolean; existingMember: boolean; diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index d82c6a8f2..510910539 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -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; 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 { public renderQuote() { const { conversationType, - authorColor, direction, i18n, quote, @@ -599,8 +596,6 @@ export class Message extends React.PureComponent { 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 { 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 { authorProfileName, collapseMetadata, senderIsModerator, - authorColor, conversationType, direction, i18n, @@ -1052,7 +1045,6 @@ export class Message extends React.PureComponent { public render() { const { authorPhoneNumber, - authorColor, direction, id, isKickedFromGroup, diff --git a/ts/components/conversation/ModeratorsAddDialog.tsx b/ts/components/conversation/ModeratorsAddDialog.tsx index 71ad9cd38..c97b6a869 100644 --- a/ts/components/conversation/ModeratorsAddDialog.tsx +++ b/ts/components/conversation/ModeratorsAddDialog.tsx @@ -51,7 +51,6 @@ export class AddModeratorsDialog extends React.Component { authorProfileName: name, selected: false, authorName: name, - authorColor: d.getColor(), checkmarked: false, existingMember, }; @@ -97,7 +96,6 @@ export class AddModeratorsDialog extends React.Component { authorAvatarPath: '', selected: true, authorName: this.state.inputBoxValue, - authorColor: '#000000', checkmarked: true, existingMember: false, }); diff --git a/ts/components/conversation/ModeratorsRemoveDialog.tsx b/ts/components/conversation/ModeratorsRemoveDialog.tsx index 85d830938..bc00b10d7 100644 --- a/ts/components/conversation/ModeratorsRemoveDialog.tsx +++ b/ts/components/conversation/ModeratorsRemoveDialog.tsx @@ -34,7 +34,6 @@ export class RemoveModeratorsDialog extends React.Component { 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 { authorProfileName: name, selected: false, authorName: name, - authorColor, checkmarked: true, existingMember, }; diff --git a/ts/components/conversation/Quote.tsx b/ts/components/conversation/Quote.tsx index cf9a27c9e..3737817b9 100644 --- a/ts/components/conversation/Quote.tsx +++ b/ts/components/conversation/Quote.tsx @@ -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 { public render() { const { - authorColor, isIncoming, onClick, referencedMessageNotFound, diff --git a/ts/components/conversation/UpdateGroupMembersDialog.tsx b/ts/components/conversation/UpdateGroupMembersDialog.tsx index a8f60afd9..97ce71de7 100644 --- a/ts/components/conversation/UpdateGroupMembersDialog.tsx +++ b/ts/components/conversation/UpdateGroupMembersDialog.tsx @@ -52,7 +52,6 @@ export class UpdateGroupMembersDialog extends React.Component { authorAvatarPath: d?.cachedProps?.avatarPath, selected: false, authorName: name, // different from ProfileName? - authorColor: d.getColor(), checkmarked: false, existingMember, }; diff --git a/ts/components/session/ActionsPanel.tsx b/ts/components/session/ActionsPanel.tsx index 16ad70c82..a8f1ea8f7 100644 --- a/ts/components/session/ActionsPanel.tsx +++ b/ts/components/session/ActionsPanel.tsx @@ -122,7 +122,6 @@ export class ActionsPanel extends React.Component { onSelect?: (event: SectionType) => void; type: SectionType; avatarPath?: string; - avatarColor?: string; notificationCount?: number; }) => { const handleClick = onSelect diff --git a/ts/components/session/SessionClosableOverlay.tsx b/ts/components/session/SessionClosableOverlay.tsx index 3977aa86f..342859376 100644 --- a/ts/components/session/SessionClosableOverlay.tsx +++ b/ts/components/session/SessionClosableOverlay.tsx @@ -95,7 +95,6 @@ export class SessionClosableOverlay extends React.Component { authorAvatarPath: d.avatarPath, selected: false, authorName: name, - authorColor: d.color, checkmarked: false, existingMember, }; diff --git a/ts/components/session/SessionMemberListItem.tsx b/ts/components/session/SessionMemberListItem.tsx index 7a07d20d9..7497800b5 100644 --- a/ts/components/session/SessionMemberListItem.tsx +++ b/ts/components/session/SessionMemberListItem.tsx @@ -10,7 +10,6 @@ export interface ContactType { authorProfileName: string; authorPhoneNumber: string; authorName: string; - authorColor: any; authorAvatarPath: string; checkmarked: boolean; existingMember: boolean;