;
@@ -111,6 +113,7 @@ const renderMembershipRow = ({
export const ConversationHero = ({
i18n,
+ about,
avatarPath,
color,
conversationType,
@@ -188,6 +191,11 @@ export const ConversationHero = ({
/>
)}
+ {about && (
+
+ )}
{!isMe ? (
{membersCount === 1
diff --git a/ts/model-types.d.ts b/ts/model-types.d.ts
index 03e7c37702..64ada8a477 100644
--- a/ts/model-types.d.ts
+++ b/ts/model-types.d.ts
@@ -201,6 +201,8 @@ export type ConversationAttributesType = {
e164?: string;
// Private other fields
+ about?: string;
+ aboutEmoji?: string;
profileFamilyName?: string;
profileKey?: string;
profileName?: string;
diff --git a/ts/models/conversations.ts b/ts/models/conversations.ts
index ba2496a84a..3f06beecc9 100644
--- a/ts/models/conversations.ts
+++ b/ts/models/conversations.ts
@@ -1173,6 +1173,7 @@ export class ConversationModel extends window.Backbone.Model<
uuid: this.get('uuid'),
e164: this.get('e164'),
+ about: this.getAboutText(),
acceptedMessageRequest: this.getAccepted(),
activeAt: this.get('active_at')!,
areWePending: Boolean(
@@ -1884,6 +1885,17 @@ export class ConversationModel extends window.Backbone.Model<
return !this.get('profileSharing');
}
+ getAboutText(): string | undefined {
+ if (!this.get('about')) {
+ return undefined;
+ }
+
+ return window.i18n('message--getNotificationText--text-with-emoji', {
+ text: this.get('about'),
+ emoji: this.get('aboutEmoji'),
+ });
+ }
+
/**
* Determine if this conversation should be considered "accepted" in terms
* of message requests
@@ -3755,6 +3767,30 @@ export class ConversationModel extends window.Backbone.Model<
});
}
+ if (profile.about) {
+ const key = this.get('profileKey');
+ if (key) {
+ const keyBuffer = base64ToArrayBuffer(key);
+ const decrypted = await window.textsecure.crypto.decryptProfile(
+ base64ToArrayBuffer(profile.about),
+ keyBuffer
+ );
+ this.set('about', stringFromBytes(decrypted));
+ }
+ }
+
+ if (profile.aboutEmoji) {
+ const key = this.get('profileKey');
+ if (key) {
+ const keyBuffer = base64ToArrayBuffer(key);
+ const decrypted = await window.textsecure.crypto.decryptProfile(
+ base64ToArrayBuffer(profile.aboutEmoji),
+ keyBuffer
+ );
+ this.set('aboutEmoji', stringFromBytes(decrypted));
+ }
+ }
+
if (profile.capabilities) {
c.set({ capabilities: profile.capabilities });
}
@@ -3900,6 +3936,8 @@ export class ConversationModel extends window.Backbone.Model<
`Setting sealedSender to UNKNOWN for conversation ${this.idForLogging()}`
);
this.set({
+ about: undefined,
+ aboutEmoji: undefined,
profileAvatar: undefined,
profileKey,
profileKeyVersion: undefined,
@@ -3943,6 +3981,8 @@ export class ConversationModel extends window.Backbone.Model<
}
this.set({
+ about: undefined,
+ aboutEmoji: undefined,
profileKey: undefined,
profileKeyVersion: undefined,
profileKeyCredential: null,
diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts
index 162958373f..7d404f284c 100644
--- a/ts/state/ducks/conversations.ts
+++ b/ts/state/ducks/conversations.ts
@@ -51,6 +51,7 @@ export type ConversationType = {
name?: string;
firstName?: string;
profileName?: string;
+ about?: string;
avatarPath?: string;
areWeAdmin?: boolean;
areWePending?: boolean;
diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json
index 315455e1f9..0a9a22e3d3 100644
--- a/ts/util/lint/exceptions.json
+++ b/ts/util/lint/exceptions.json
@@ -14745,7 +14745,7 @@
"rule": "React-useRef",
"path": "ts/components/conversation/ContactModal.js",
"line": " const overlayRef = react_1.default.useRef(null);",
- "lineNumber": 17,
+ "lineNumber": 18,
"reasonCategory": "usageTrusted",
"updated": "2020-11-09T17:48:12.173Z"
},
@@ -14753,7 +14753,7 @@
"rule": "React-useRef",
"path": "ts/components/conversation/ContactModal.js",
"line": " const closeButtonRef = react_1.default.useRef(null);",
- "lineNumber": 18,
+ "lineNumber": 19,
"reasonCategory": "usageTrusted",
"updated": "2020-11-10T21:27:04.909Z"
},
@@ -14779,7 +14779,7 @@
"rule": "React-useRef",
"path": "ts/components/conversation/ConversationHero.js",
"line": " const firstRenderRef = React.useRef(true);",
- "lineNumber": 80,
+ "lineNumber": 81,
"reasonCategory": "falseMatch",
"updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Doesn't refer to a DOM element."
@@ -14788,7 +14788,7 @@
"rule": "React-useRef",
"path": "ts/components/conversation/ConversationHero.tsx",
"line": " const firstRenderRef = React.useRef(true);",
- "lineNumber": 127,
+ "lineNumber": 130,
"reasonCategory": "falseMatch",
"updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Doesn't refer to a DOM element."
@@ -15300,4 +15300,4 @@
"updated": "2021-01-08T15:46:32.143Z",
"reasonDetail": "Doesn't manipulate the DOM. This is just a function."
}
-]
\ No newline at end of file
+]