M src/SnikketChatService.ts => src/SnikketChatService.ts +2 -1
@@ 782,8 782,9 @@ export class SnikketChatService implements IChatService {
this.xmppClient.findAvailableChats(q, callback);
}
- startChat(availableChat: snikket.AvailableChat) {
+ startChat(availableChat: snikket.AvailableChat, trust: boolean) {
const chat = this.xmppClient.startChat(availableChat);
+ if (trust) chat.setTrusted(trust);
chat.bookmark();
this.storage.setActiveConversation(chat.chatId);
this.doStateUpdate();
M src/components/Chat.tsx => src/components/Chat.tsx +3 -2
@@ 934,17 934,18 @@ export const Chat = ({ persistence }: { persistence: any }) => {
key={result.chatId}
name={result.displayName}
info={result.note}
+ onClick={(e) => snikketService.startChat(result, false)}
>
<Conversation.Operations visible>
{!result.caps.isChannel(result.chatId) && (
<AddUserButton
- onClick={(e) => snikketService.startChat(result)}
+ onClick={(e) => snikketService.startChat(result, true)}
/>
)}
{result.caps.isChannel(result.chatId) && (
<ArrowButton
direction="right"
- onClick={(e) => snikketService.startChat(result)}
+ onClick={(e) => snikketService.startChat(result, true)}
/>
)}
</Conversation.Operations>