change bot username to id

This commit is contained in:
Sharon Kennedy 2020-03-22 11:07:41 -04:00
parent 621fa75885
commit 8ee452e2d3
3 changed files with 11 additions and 11 deletions

View File

@ -14,7 +14,7 @@
<script> <script>
var config = { var config = {
matrixServerUrl: 'https://matrix.rhok.space', matrixServerUrl: 'https://matrix.rhok.space',
botUsername: '@help-bot:rhok.space', botId: '@help-bot:rhok.space',
roomName: 'Support Chat', roomName: 'Support Chat',
termsUrl: 'https://tosdr.org/', termsUrl: 'https://tosdr.org/',
introMessage: 'This chat application does not collect any of your personal data or any data from your use of this service.', introMessage: 'This chat application does not collect any of your personal data or any data from your use of this service.',

View File

@ -25,7 +25,7 @@ const UNENCRYPTION_NOTICE = "End-to-end message encryption is not available on t
const RESTARTING_UNENCRYPTED_CHAT_MESSAGE = "Restarting chat without encryption." const RESTARTING_UNENCRYPTED_CHAT_MESSAGE = "Restarting chat without encryption."
const DEFAULT_MATRIX_SERVER = "https://matrix.rhok.space/" const DEFAULT_MATRIX_SERVER = "https://matrix.rhok.space/"
const DEFAULT_BOT_USERNAME = "@help-bot:rhok.space" const DEFAULT_BOT_ID = "@help-bot:rhok.space"
const DEFAULT_TERMS_URL = "https://tosdr.org/" const DEFAULT_TERMS_URL = "https://tosdr.org/"
const DEFAULT_ROOM_NAME = "Support Chat" const DEFAULT_ROOM_NAME = "Support Chat"
const DEFAULT_INTRO_MESSAGE = "This chat application does not collect any of your personal data or any data from your use of this service." const DEFAULT_INTRO_MESSAGE = "This chat application does not collect any of your personal data or any data from your use of this service."
@ -252,7 +252,7 @@ class ChatBox extends React.Component {
const chatTime = currentDate.toLocaleTimeString() const chatTime = currentDate.toLocaleTimeString()
let roomConfig = { let roomConfig = {
room_alias_name: `private-support-chat-${uuid()}`, room_alias_name: `private-support-chat-${uuid()}`,
invite: [this.props.botUsername], invite: [this.props.botId],
visibility: 'private', visibility: 'private',
name: `${chatTime}, ${chatDate} - ${this.props.roomName}`, name: `${chatTime}, ${chatDate} - ${this.props.roomName}`,
} }
@ -271,7 +271,7 @@ class ChatBox extends React.Component {
const { room_id } = await this.state.client.createRoom(roomConfig) const { room_id } = await this.state.client.createRoom(roomConfig)
this.state.client.setPowerLevel(room_id, this.props.botUsername, 100) this.state.client.setPowerLevel(room_id, this.props.botId, 100)
if (isCryptoEnabled) { if (isCryptoEnabled) {
this.verifyAllRoomDevices(room_id) this.verifyAllRoomDevices(room_id)
@ -325,7 +325,7 @@ class ChatBox extends React.Component {
const msg = { const msg = {
id: uuid(), id: uuid(),
type: 'm.room.message', type: 'm.room.message',
sender: this.props.botUsername, sender: this.props.botId,
roomId: roomId || this.state.roomId, roomId: roomId || this.state.roomId,
content: content, content: content,
} }
@ -487,7 +487,7 @@ class ChatBox extends React.Component {
{ {
messages.map((message, index) => { messages.map((message, index) => {
return( return(
<Message key={message.id} message={message} userId={userId} botId={this.props.botUsername} client={this.state.client} /> <Message key={message.id} message={message} userId={userId} botId={this.props.botId} client={this.state.client} />
) )
}) })
} }
@ -528,9 +528,9 @@ class ChatBox extends React.Component {
ChatBox.propTypes = { ChatBox.propTypes = {
matrixServerUrl: PropTypes.string.isRequired, matrixServerUrl: PropTypes.string.isRequired,
botUsername: PropTypes.string.isRequired, botId: PropTypes.string.isRequired,
termsUrl: PropTypes.string.isRequired, termsUrl: PropTypes.string,
introMessage: PropTypes.string.isRequired, introMessage: PropTypes.string,
roomName: PropTypes.string, roomName: PropTypes.string,
agreementMessage: PropTypes.string, agreementMessage: PropTypes.string,
confirmationMessage: PropTypes.string, confirmationMessage: PropTypes.string,
@ -541,7 +541,7 @@ ChatBox.propTypes = {
ChatBox.defaultProps = { ChatBox.defaultProps = {
matrixServerUrl: DEFAULT_MATRIX_SERVER, matrixServerUrl: DEFAULT_MATRIX_SERVER,
botUsername: DEFAULT_BOT_USERNAME, botId: DEFAULT_BOT_ID,
termsUrl: DEFAULT_TERMS_URL, termsUrl: DEFAULT_TERMS_URL,
roomName: DEFAULT_ROOM_NAME, roomName: DEFAULT_ROOM_NAME,
introMessage: DEFAULT_INTRO_MESSAGE, introMessage: DEFAULT_INTRO_MESSAGE,

View File

@ -2,7 +2,7 @@ import EmbeddableChatbox from './embeddable-chatbox';
const config = { const config = {
matrixServerUrl: 'https://matrix.rhok.space', matrixServerUrl: 'https://matrix.rhok.space',
botUsername: '@help-bot:rhok.space', botId: '@help-bot:rhok.space',
roomName: 'Support Chat', roomName: 'Support Chat',
termsUrl: 'https://tosdr.org/', termsUrl: 'https://tosdr.org/',
introMessage: 'This chat application does not collect any of your personal data or any data from your use of this service.', introMessage: 'This chat application does not collect any of your personal data or any data from your use of this service.',