do not remove convo when removing only message

use the user pubkey if group update notification with an unknown user
make GroupNotification a function component
pull/1387/head
Audric Ackermann 4 years ago
parent 95101bfd3c
commit dfbcf3ac9b
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -2339,19 +2339,11 @@
this.messageCollection.reset([]);
// let's try to keep the RSS conversation open just empty...
if (this.isRss()) {
this.set({
lastMessage: null,
});
} else {
// this will remove the conversation from conversation lists...
this.set({
lastMessage: null,
timestamp: null,
active_at: null,
});
}
// destroy message keeps the active timestamp set so the
// conversation still appears on the conversation list but is empty
this.set({
lastMessage: null,
});
await this.commit();
},

@ -173,7 +173,7 @@
if (!conversation) {
return number;
}
return conversation.getProfileName();
return conversation.getDisplayName();
},
getLokiNameForNumber(number) {
const conversation = ConversationController.get(number);

@ -32,9 +32,6 @@ const {
EmbeddedContact,
} = require('../../ts/components/conversation/EmbeddedContact');
const { Emojify } = require('../../ts/components/conversation/Emojify');
const {
GroupNotification,
} = require('../../ts/components/conversation/GroupNotification');
const { Lightbox } = require('../../ts/components/Lightbox');
const { LightboxGallery } = require('../../ts/components/LightboxGallery');
const { MemberList } = require('../../ts/components/conversation/MemberList');
@ -261,7 +258,6 @@ exports.setup = (options = {}) => {
SettingsView,
EmbeddedContact,
Emojify,
GroupNotification,
Lightbox,
LightboxGallery,
MemberList,

@ -2,8 +2,6 @@ import React from 'react';
import { compact, flatten } from 'lodash';
import { Intl } from '../Intl';
import { LocalizerType } from '../../types/Util';
import { missingCaseError } from '../../util/missingCaseError';
interface Contact {
@ -23,10 +21,11 @@ interface Props {
changes: Array<Change>;
}
// This class is used to display group updates in the conversation view.
// This component is used to display group updates in the conversation view.
// This is a not a "notification" as the name suggests, but a message inside the conversation
export class GroupNotification extends React.Component<Props> {
public renderChange(change: Change) {
export const GroupNotification = (props: Props) => {
function renderChange(change: Change) {
const { isMe, contacts, type, newName } = change;
const { i18n } = window;
@ -94,17 +93,16 @@ export class GroupNotification extends React.Component<Props> {
}
}
public render() {
const { changes } = this.props;
return (
<div className="module-group-notification">
{(changes || []).map((change, index) => (
<div key={index} className="module-group-notification__change">
{this.renderChange(change)}
</div>
))}
</div>
);
}
const { changes } = props;
return (
<div className="module-group-notification">
{(changes || []).map((change, index) => (
<div key={index} className="module-group-notification__change">
{renderChange(change)}
</div>
))}
</div>
);
}

@ -134,6 +134,7 @@ export class SessionConversation extends React.Component<Props, State> {
// this.getMessages.bind(this),
// 1000 // one second
// );
this.getMessages = this.getMessages.bind(this);
// Keyboard navigation
this.onKeyDown = this.onKeyDown.bind(this);

Loading…
Cancel
Save