Merge pull request #2875 from oxen-io/clearnet

trim pubkey before starting convo +  admin actions for sogs on message click
pull/3109/head
Audric Ackermann 2 years ago committed by GitHub
commit 94bddfd22c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,18 +24,6 @@ import {
showMessageDetailsView,
toggleSelectedMessageId,
} from '../../../../state/ducks/conversations';
import {
useSelectedConversationKey,
useSelectedIsBlocked,
useSelectedIsPublic,
useSelectedWeAreAdmin,
useSelectedWeAreModerator,
} from '../../../../state/selectors/selectedConversation';
import { saveAttachmentToDisk } from '../../../../util/attachmentsUtil';
import { Reactions } from '../../../../util/reactions';
import { SessionContextMenuContainer } from '../../../SessionContextMenuContainer';
import { SessionEmojiPanel, StyledEmojiPanel } from '../../SessionEmojiPanel';
import { MessageReactBar } from './MessageReactBar';
import {
useMessageAttachments,
useMessageBody,
@ -48,7 +36,18 @@ import {
useMessageStatus,
useMessageTimestamp,
} from '../../../../state/selectors';
import { useIsPublic } from '../../../../hooks/useParamSelector';
import {
useSelectedConversationKey,
useSelectedIsBlocked,
useSelectedIsPublic,
useSelectedWeAreAdmin,
useSelectedWeAreModerator,
} from '../../../../state/selectors/selectedConversation';
import { saveAttachmentToDisk } from '../../../../util/attachmentsUtil';
import { Reactions } from '../../../../util/reactions';
import { SessionContextMenuContainer } from '../../../SessionContextMenuContainer';
import { SessionEmojiPanel, StyledEmojiPanel } from '../../SessionEmojiPanel';
import { MessageReactBar } from './MessageReactBar';
export type MessageContextMenuSelectorProps = Pick<
MessageRenderingProps,
@ -149,10 +148,11 @@ const SaveAttachment = ({ messageId }: MessageId) => {
const AdminActionItems = ({ messageId }: MessageId) => {
const convoId = useSelectedConversationKey();
const isPublic = useIsPublic();
const isPublic = useSelectedIsPublic();
const weAreModerator = useSelectedWeAreModerator();
const weAreAdmin = useSelectedWeAreAdmin();
const showAdminActions = (weAreAdmin || weAreModerator) && isPublic;
const sender = useMessageSender(messageId);
const isSenderAdmin = useMessageSenderIsAdmin(messageId);

@ -86,7 +86,7 @@ export const OverlayMessage = () => {
const pubkeyorOnsTrimmed = pubkeyOrOns.trim();
if (!PubKey.validateWithErrorNoBlinding(pubkeyorOnsTrimmed)) {
await openConvoOnceResolved(pubkeyOrOns);
await openConvoOnceResolved(pubkeyorOnsTrimmed);
return;
}

Loading…
Cancel
Save