Added forward message user lookup

This commit is contained in:
Justin Ferrari 2022-12-22 21:38:31 -05:00
parent 87f4ebff96
commit 8be65cff5c
9 changed files with 885 additions and 555 deletions

Binary file not shown.

Binary file not shown.

View File

@ -18,6 +18,20 @@
url(Montserrat.ttf) format('truetype'); url(Montserrat.ttf) format('truetype');
} }
@font-face {
font-family: 'KoHo';
src: local('KoHo'),
local('KoHo'),
url(KoHo.ttf) format('truetype');
}
@font-face {
font-family: 'Livvic';
src: local('Livvic'),
local('Livvic'),
url(Livvic.ttf) format('truetype');
}
.material-icons { .material-icons {
font-family: 'Material Icons'; font-family: 'Material Icons';
font-weight: normal; font-weight: normal;

View File

@ -466,7 +466,7 @@
"cchange4": "New Message", "cchange4": "New Message",
"cchange5": "(Click to scroll down)", "cchange5": "(Click to scroll down)",
"cchange6": "Type the name or address of who you want to chat with to send a private message! You can validate the person's name by clicking on the book icon.", "cchange6": "Type the name or address of who you want to chat with to send a private message! You can validate the person's name by clicking on the book icon.",
"cchange7": "Name / Address", "cchange7": "Username / Address",
"cchange8": "Message...", "cchange8": "Message...",
"cchange9": "Send", "cchange9": "Send",
"cchange10": "Blocked Users List", "cchange10": "Blocked Users List",
@ -478,7 +478,7 @@
"cchange16": "Successfully unblocked this user.", "cchange16": "Successfully unblocked this user.",
"cchange17": "Error occurred when trying to unblock this user. Please try again!", "cchange17": "Error occurred when trying to unblock this user. Please try again!",
"cchange18": "unblock", "cchange18": "unblock",
"cchange19": "Invalid Name / Address, Check the name / address and retry...", "cchange19": "Invalid Username / Address, Check the name / address and retry...",
"cchange20": "Message Sent Successfully!", "cchange20": "Message Sent Successfully!",
"cchange21": "Sending failed, Please retry...", "cchange21": "Sending failed, Please retry...",
"cchange22": "Loading Messages...", "cchange22": "Loading Messages...",
@ -495,7 +495,8 @@
"cchange34": "This chat message is using an older message version and cannot use this feature.", "cchange34": "This chat message is using an older message version and cannot use this feature.",
"cchange35": "Error when trying to fetch the user's name. Please try again!", "cchange35": "Error when trying to fetch the user's name. Please try again!",
"cchange36": "Search Results", "cchange36": "Search Results",
"cchange37": "No Results Found" "cchange37": "No Results Found",
"cchange38": "User Verified"
}, },
"welcomepage": { "welcomepage": {
"wcchange1": "Welcome to Q-Chat", "wcchange1": "Welcome to Q-Chat",
@ -524,7 +525,7 @@
"bcchange13": "Reaction", "bcchange13": "Reaction",
"bcchange14": "Forward", "bcchange14": "Forward",
"bcchange15": "Message Forwarded", "bcchange15": "Message Forwarded",
"bcchange16": "Choose recipient", "bcchange16": "Choose Recipient or Search for One Below",
"bcchange17": "FORWARDED" "bcchange17": "FORWARDED"
}, },
"grouppage": { "grouppage": {

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,6 @@ export class ChatSearchResults extends LitElement {
static styles = [chatSearchResultsStyles] static styles = [chatSearchResultsStyles]
render() { render() {
console.log(10, "search results here");
return html` return html`
<div class="chat-results-card" style=${this.isOpen ? "display: block;" : "display: none;"}> <div class="chat-results-card" style=${this.isOpen ? "display: block;" : "display: none;"}>
<vaadin-icon <vaadin-icon
@ -49,7 +48,7 @@ export class ChatSearchResults extends LitElement {
this.onClickFunc(result); this.onClickFunc(result);
}}> }}>
<p class="chat-result"> <p class="chat-result">
${result} ${result.name}
</p> </p>
</div> </div>
` `

View File

@ -57,6 +57,10 @@ class ChatSelect extends LitElement {
color: #92959e; color: #92959e;
} }
.name {
user-select: none;
}
.clearfix:after { .clearfix:after {
visibility: hidden; visibility: hidden;
display: block; display: block;
@ -122,13 +126,60 @@ class ChatSelect extends LitElement {
} }
return html` return html`
<li @click=${() => this.getUrl(this.chatInfo.url)} class="clearfix ${this.activeChatHeadUrl === this.chatInfo.url ? 'active' : ''}"> <li
${this.isImageLoaded ? html`${avatarImg}` : html`` } @click=${() => this.getUrl(this.chatInfo.url)}
${!this.isImageLoaded && !this.chatInfo.name && !this.chatInfo.groupName ? html`<mwc-icon class="img-icon">account_circle</mwc-icon>` : html`` } class="clearfix ${this.activeChatHeadUrl === this.chatInfo.url ? 'active' : ''}">
${!this.isImageLoaded && this.chatInfo.name ? html`<div style="width:40px; height:40px; float: left; border-radius:50%; background: ${this.activeChatHeadUrl === this.chatInfo.url ? 'var(--chatHeadBgActive)' : 'var(--chatHeadBg)' }; color: ${this.activeChatHeadUrl === this.chatInfo.url ? 'var(--chatHeadTextActive)' : 'var(--chatHeadText)' }; font-weight:bold; display: flex; justify-content: center; align-items: center; text-transform: capitalize">${this.chatInfo.name.charAt(0)}</div>`: ''} ${this.isImageLoaded ? html`${avatarImg}` : html``}
${!this.isImageLoaded && this.chatInfo.groupName ? html`<div style="width:40px; height:40px; float: left; border-radius:50%; background: ${this.activeChatHeadUrl === this.chatInfo.url ? 'var(--chatHeadBgActive)' : 'var(--chatHeadBg)' }; color: ${this.activeChatHeadUrl === this.chatInfo.url ? 'var(--chatHeadTextActive)' : 'var(--chatHeadText)' }; font-weight:bold; display: flex; justify-content: center; align-items: center; text-transform: capitalize">${this.chatInfo.groupName.charAt(0)}</div>`: ''} ${!this.isImageLoaded && !this.chatInfo.name && !this.chatInfo.groupName ? html`<mwc-icon class="img-icon">account_circle</mwc-icon>` :
html``
}
${!this.isImageLoaded && this.chatInfo.name ?
html`
<div
style="width:40px; height:40px; float: left; border-radius:50%; background: ${this.activeChatHeadUrl === this.chatInfo.url ?
'var(--chatHeadBgActive)' :
'var(--chatHeadBg)' };
color: ${this.activeChatHeadUrl === this.chatInfo.url ?
'var(--chatHeadTextActive)' :
'var(--chatHeadText)'};
font-weight:bold;
display: flex;
justify-content: center;
align-items: center;
text-transform: capitalize">
${this.chatInfo.name.charAt(0)}
</div>`:
''}
${!this.isImageLoaded && this.chatInfo.groupName ?
html`
<div
style="width:40px;
height:40px;
float: left;
border-radius:50%;
background: ${this.activeChatHeadUrl === this.chatInfo.url ?
'var(--chatHeadBgActive)' :
'var(--chatHeadBg)' };
color: ${this.activeChatHeadUrl === this.chatInfo.url ?
'var(--chatHeadTextActive)' :
'var(--chatHeadText)' };
font-weight:bold;
display: flex;
justify-content: center;
align-items: center;
text-transform: capitalize">
${this.chatInfo.groupName.charAt(0)}
</div>`:
''}
<div class="about"> <div class="about">
<div class="name"><span style="float:left; padding-left: 8px; color: var(--chat-group);">${this.chatInfo.groupName ? this.chatInfo.groupName : this.chatInfo.name !== undefined ? this.chatInfo.name : this.chatInfo.address.substr(0, 15)} </span> </div> <div class="name">
<span style="float:left; padding-left: 8px; color: var(--chat-group);">
${this.chatInfo.groupName ?
this.chatInfo.groupName :
this.chatInfo.name !== undefined ? this.chatInfo.name :
this.chatInfo.address.substr(0, 15)}
</span>
</div>
</div> </div>
</li> </li>
` `

View File

@ -363,14 +363,14 @@ class ChatTextEditor extends LitElement {
return true return true
} }
sendMessageFunc() { sendMessageFunc(props) {
if (this.chatMessageSize > 1000 ) { if (this.chatMessageSize > 1000 ) {
parentEpml.request('showSnackBar', get("chatpage.cchange29")); parentEpml.request('showSnackBar', get("chatpage.cchange29"));
return; return;
}; };
this.chatMessageSize = 0; this.chatMessageSize = 0;
this.chatEditor.updateMirror(); this.chatEditor.updateMirror();
this._sendMessage(); this._sendMessage(props);
} }
getMessageSize(message){ getMessageSize(message){

View File

@ -42,17 +42,16 @@ class Chat extends LitElement {
privateMessagePlaceholder: { type: String}, privateMessagePlaceholder: { type: String},
chatEditor: { type: Object }, chatEditor: { type: Object },
imageFile: { type: Object }, imageFile: { type: Object },
activeChatHeadUrl: {type: String}, activeChatHeadUrl: { type: String },
openPrivateMessage: { type: Boolean }, openPrivateMessage: { type: Boolean },
userFound: { type: Array}, userFound: { type: Array},
userFoundModalOpen: { type: Boolean }, userFoundModalOpen: { type: Boolean },
userSelected: { type: String} userSelected: { type: Object }
} }
} }
static styles = [qchatStyles] static styles = [qchatStyles]
constructor() { constructor() {
super() super()
this.selectedAddress = {} this.selectedAddress = {}
@ -84,7 +83,7 @@ class Chat extends LitElement {
this.openPrivateMessage = false this.openPrivateMessage = false
this.userFound = [] this.userFound = []
this.userFoundModalOpen = false this.userFoundModalOpen = false
this.userSelected = '' this.userSelected = {}
} }
async setActiveChatHeadUrl(url) { async setActiveChatHeadUrl(url) {
@ -94,7 +93,6 @@ class Chat extends LitElement {
} }
render() { render() {
console.log(22, "here");
return html` return html`
<div class="container clearfix"> <div class="container clearfix">
<div class="people-list" id="people-list"> <div class="people-list" id="people-list">
@ -149,13 +147,16 @@ class Chat extends LitElement {
?disabled=${this.isLoading} ?disabled=${this.isLoading}
id="sendTo" id="sendTo"
placeholder="${translate("chatpage.cchange7")}" placeholder="${translate("chatpage.cchange7")}"
value=${this.userSelected} value=${this.userSelected.name}
@keypress=${() => this.userSelected = ""} @keypress=${() => {
this.userSelected = {};
this.requestUpdate();
}}
/> />
${this.userSelected ? ( ${this.userSelected.name ? (
html` html`
<div class="user-verified"> <div class="user-verified">
<p >User Verified</p> <p >${translate("chatpage.cchange38")}</p>
<vaadin-icon icon="vaadin:check-circle-o" slot="icon"></vaadin-icon> <vaadin-icon icon="vaadin:check-circle-o" slot="icon"></vaadin-icon>
</div> </div>
` `
@ -198,7 +199,7 @@ class Chat extends LitElement {
</button> </button>
<button <button
class="modal-button" class="modal-button"
@click=${this.sendMessageFunc} @click=${this._sendMessage}
?disabled="${this.isLoading}"> ?disabled="${this.isLoading}">
${this.isLoading === false ${this.isLoading === false
? this.renderSendText() ? this.renderSendText()
@ -394,15 +395,6 @@ class Chat extends LitElement {
parentEpml.imReady() parentEpml.imReady()
} }
async updated(changedProperties) {
if (changedProperties && changedProperties.has('userFound')) {
console.log(this.userFound, "user found array here");
}
if (changedProperties && changedProperties.has('userSelected')) {
console.log(this.userSelected, "user selected here");
}
}
async userSearch() { async userSearch() {
const nameValue = this.shadowRoot.getElementById('sendTo').value; const nameValue = this.shadowRoot.getElementById('sendTo').value;
if(!nameValue) { if(!nameValue) {
@ -420,7 +412,7 @@ class Chat extends LitElement {
} else { } else {
this.userFound = [ this.userFound = [
...this.userFound, ...this.userFound,
result.name, result,
]; ];
} }
this.userFoundModalOpen = true; this.userFoundModalOpen = true;