fix metadatabadges for closed group

do not show crown nor Mod badge
pull/1459/head
Audric Ackermann 4 years ago
parent 9645c210dd
commit 34e5648681

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

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

@ -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) // the conversation with the primary device of that source (can be the same as conversationOrigin)
const conversation = ConversationController.getInstance().getOrThrow( const conversation = ConversationController.getInstance().get(conversationId);
conversationId
); if (!conversation) {
window.log.warn('Skipping handleJob for unknown convo: ', conversationId);
return;
}
conversation.queueJob(async () => { conversation.queueJob(async () => {
await handleMessageJob( await handleMessageJob(

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

Loading…
Cancel
Save