~singpolyma/snikket-react

130757ddee8349cc4ee357f9eab0bea96b980a1f — Stephen Paul Weber 6 days ago 069fa00
Click row for open untrusted, add for add trusted
2 files changed, 5 insertions(+), 3 deletions(-)

M src/SnikketChatService.ts
M src/components/Chat.tsx
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>