{i18n('ConversationDetailsHeader--members', [
memberships.length.toString(),
diff --git a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx
index 656c149bd..382a9a6ca 100644
--- a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx
+++ b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.tsx
@@ -5,6 +5,7 @@ import React from 'react';
import { LocalizerType } from '../../../types/Util';
import { Avatar } from '../../Avatar';
+import { Emojify } from '../Emojify';
import { ConversationDetailsIcon } from './ConversationDetailsIcon';
import { ConversationType } from '../../../state/ducks/conversations';
@@ -108,7 +109,7 @@ export const ConversationDetailsMembershipList: React.ComponentType
= ({
{...member}
/>
}
- label={member.isMe ? i18n('you') : member.title}
+ label={}
right={isAdmin ? i18n('GroupV2--admin') : ''}
/>
))}
diff --git a/ts/groups.ts b/ts/groups.ts
index fcfe7b8bd..ac3accc85 100644
--- a/ts/groups.ts
+++ b/ts/groups.ts
@@ -3452,7 +3452,7 @@ async function getCurrentGroupState({
logId
);
- const oldVersion = group.version;
+ const oldVersion = group.revision;
const newVersion = decryptedGroupState.version;
window.log.info(
`getCurrentGroupState/${logId}: Applying full group state, from version ${oldVersion} to ${newVersion}.`
diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts
index 7acdec646..65571726f 100644
--- a/ts/models/conversations.ts
+++ b/ts/models/conversations.ts
@@ -2543,7 +2543,7 @@ export class ConversationModel extends window.Backbone
sent_at: now,
received_at: window.Signal.Util.incrementMessageCounter(),
received_at_ms: now,
- unread: 1,
+ unread: 0,
changedId: conversationId || this.id,
profileChange,
// TODO: DESKTOP-722
diff --git a/ts/models/messages.ts b/ts/models/messages.ts
index 24dd9c853..088a5b9cf 100644
--- a/ts/models/messages.ts
+++ b/ts/models/messages.ts
@@ -21,7 +21,10 @@ import {
MessageStatusType,
PropsData,
} from '../components/conversation/Message';
-import { OwnProps as SmartMessageDetailPropsType } from '../state/smart/MessageDetail';
+import {
+ OwnProps as SmartMessageDetailPropsType,
+ Contact as SmartMessageDetailContact,
+} from '../state/smart/MessageDetail';
import { CallbackResultType } from '../textsecure/SendMessage';
import * as expirationTimer from '../util/expirationTimer';
import { missingCaseError } from '../util/missingCaseError';
@@ -464,33 +467,51 @@ export class MessageModel extends window.Backbone.Model {
return window.ConversationController.getConversationId(identifier);
});
- const finalContacts = (conversationIds || []).map(id => {
- const errorsForContact = errorsGroupedById[id];
- const isOutgoingKeyError = Boolean(
- _.find(errorsForContact, error => error.name === OUTGOING_KEY_ERROR)
- );
- const isUnidentifiedDelivery =
- window.storage.get('unidentifiedDeliveryIndicators') &&
- this.isUnidentifiedDelivery(id, unidentifiedLookup);
+ const finalContacts: Array = (
+ conversationIds || []
+ ).map(
+ (id: string): SmartMessageDetailContact => {
+ const errorsForContact = errorsGroupedById[id];
+ const isOutgoingKeyError = Boolean(
+ _.find(errorsForContact, error => error.name === OUTGOING_KEY_ERROR)
+ );
+ const isUnidentifiedDelivery =
+ window.storage.get('unidentifiedDeliveryIndicators') &&
+ this.isUnidentifiedDelivery(id, unidentifiedLookup);
- return {
- ...this.findAndFormatContact(id),
-
- status: this.getStatus(id),
- errors: errorsForContact,
- isOutgoingKeyError,
- isUnidentifiedDelivery,
- onSendAnyway: () =>
- this.trigger('force-send', { contactId: id, messageId: this.id }),
- onShowSafetyNumber: () => this.trigger('show-identity', id),
- };
- });
+ return {
+ ...this.findAndFormatContact(id),
+ status: this.getStatus(id),
+ errors: errorsForContact,
+ isOutgoingKeyError,
+ isUnidentifiedDelivery,
+ onSendAnyway: () =>
+ this.trigger('force-send', { contactId: id, messageId: this.id }),
+ onShowSafetyNumber: () => this.trigger('show-identity', id),
+ };
+ }
+ );
// The prefix created here ensures that contacts with errors are listed
// first; otherwise it's alphabetical
- const sortedContacts = _.sortBy(
- finalContacts,
- contact => `${contact.errors ? '0' : '1'}${contact.title}`
+ const collator = new Intl.Collator();
+ const sortedContacts: Array = finalContacts.sort(
+ (
+ left: SmartMessageDetailContact,
+ right: SmartMessageDetailContact
+ ): number => {
+ const leftErrors = Boolean(left.errors && left.errors.length);
+ const rightErrors = Boolean(right.errors && right.errors.length);
+
+ if (leftErrors && !rightErrors) {
+ return -1;
+ }
+ if (!leftErrors && rightErrors) {
+ return 1;
+ }
+
+ return collator.compare(left.title, right.title);
+ }
);
return {
diff --git a/ts/state/smart/MessageDetail.tsx b/ts/state/smart/MessageDetail.tsx
index 97a804478..4a285e2cd 100644
--- a/ts/state/smart/MessageDetail.tsx
+++ b/ts/state/smart/MessageDetail.tsx
@@ -18,6 +18,8 @@ import { renderEmojiPicker } from './renderEmojiPicker';
type MessageDetailProps = ComponentProps;
+export { Contact } from '../../components/conversation/MessageDetail';
+
export type OwnProps = {
contacts: Array;
errors: Array;