fix metadatabadges for closed group

do not show crown nor Mod badge
This commit is contained in:
Audric Ackermann 2021-01-27 18:08:02 +11:00
parent 9645c210dd
commit 34e5648681
4 changed files with 10 additions and 6 deletions

View file

@ -506,6 +506,7 @@ class MessageInner extends React.PureComponent<MessageRegularProps, State> {
isAdmin,
conversationType,
direction,
isPublic,
onShowUserDetails,
firstMessageOfSeries,
} = this.props;
@ -534,7 +535,7 @@ class MessageInner extends React.PureComponent<MessageRegularProps, State> {
}}
pubkey={authorPhoneNumber}
/>
{isAdmin && (
{isPublic && isAdmin && (
<div className="module-avatar__icon--crown-wrapper">
<div className="module-avatar__icon--crown" />
</div>

View file

@ -53,7 +53,7 @@ export const MetadataBadges = (props: BadgesProps): JSX.Element => {
const { id, direction, isPublic, isAdmin, withImageNoCaption } = props;
const badges = [
(isPublic && 'Public') || null,
(isAdmin && 'Mod') || null,
(isPublic && isAdmin && 'Mod') || null,
].filter(nonNullish);
if (!badges || badges.length === 0) {

View file

@ -626,9 +626,12 @@ export async function handleMessageEvent(event: MessageEvent): Promise<void> {
// the conversation with the primary device of that source (can be the same as conversationOrigin)
const conversation = ConversationController.getInstance().getOrThrow(
conversationId
);
const conversation = ConversationController.getInstance().get(conversationId);
if (!conversation) {
window.log.warn('Skipping handleJob for unknown convo: ', conversationId);
return;
}
conversation.queueJob(async () => {
await handleMessageJob(

View file

@ -298,7 +298,7 @@ export async function handlePublicMessage({ message: outerMessage }: any) {
const ev = {
// Public chat messages from ourselves should be outgoing
type: isOurDevice ? 'sent' : 'message',
data: outerMessage,
data: messageData,
confirm: () => {
/* do nothing */
},