Skip to content

Commit

Permalink
Attempt #1: Fix case mismatch on cpim.headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian committed Jan 27, 2024
1 parent 7333e4f commit 5a43d07
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 18 deletions.
2 changes: 1 addition & 1 deletion frontend/components/ThreadList/ThreadList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default {
</div>
<div class='threadlist-table'>
<div class="preview_list_container">
<ThreadPreview v-for="[key,value] in threadPreviews" :key="JSON.stringify(value)"
<ThreadPreview v-for="[key,value] in threadPreviews" :key="key"
v-bind="value" :activeThread="this.activeThread" />
</div>
<div class="link-container">
Expand Down
47 changes: 32 additions & 15 deletions frontend/components/WebTextingContainer/WebTextingContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,41 @@ export default {
//now = now + timezoneOffset;
//console.log(message)
if(message.contentType == "message/cpim"){
//console.log(message.cpim.headers[`group-uuid`]);
// console.log(this.threadPreviews.get(message.cpim.headers[`group-uuid`]));
//console.log(message.cpim.headers['group-uuid']);
// console.log(this.threadPreviews.get(message.cpim.headers['group-uuid']));
//bump this thread somehow?
//this mightnot work for a new message
console.log(message)
if(message.cpim.headers[`group-uuid`]){
let temp = this.threadPreviews.get(message.cpim.headers[`group-uuid`]);
temp.bodyPreview = "New MMS Message";
temp.timestamp = now;
this.threadPreviews.set(message.cpim.headers[`group-uuid`], temp);
}
// console.log(message.cpim.headers["group-uuid"])
// console.log(message.cpim.headers["Group-UUID"])
// console.log(message.cpim.headers['Group-UUID'])
console.log(message.cpim.headers['group-uuid'])
//outbound message case
else if(message.direction == 'outgoing'){
let temp = this.threadPreviews.get(this.$route.query.number);
console.log(this.threadPreviews.get(this.$route.query.number), " ", this.$route.query.number);
temp.bodyPreview = "New MMS Message";
temp.timestamp = now;
this.threadPreviews.set(this.$route.query.number, temp);
if(message.direction == 'outgoing'){
if(message.cpim.headers['group-uuid'] ){
let temp = this.threadPreviews.get(message.cpim.headers['group-uuid']);
temp.bodyPreview = "New MMS Message";
temp.timestamp = now;
this.threadPreviews.set(message.cpim.headers['group-uuid'], temp);
}else if(message.cpim.headers["Group-UUID"]){
let temp = this.threadPreviews.get(message.cpim.headers['Group-UUID']);
temp.bodyPreview = "New MMS Message";
temp.timestamp = now;
this.threadPreviews.set(message.cpim.headers['Group-UUID'], temp);
}
else{
if(this.$route.query.number){
let temp = this.threadPreviews.get(this.$route.query.number);
console.log(this.threadPreviews.get(this.$route.query.number), " ", this.$route.query.number);
temp.bodyPreview = "New MMS Message";
temp.timestamp = now;
this.threadPreviews.set(this.$route.query.number, temp);
}
}
}
else if(message.direction == 'incoming'){
let temp = this.threadPreviews.get(message.from);
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/SIP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function calculatePlainThreadID(message:Message, direction:string, originalTo: s

function calculateCPIMThreadID(cpim:CPIM, direction:string, originalTo: string, messageFromUser: string){
//console.log(`calculateCPIMThreadID ${cpim}`);
if(cpim.getHeader("group-uuid")) {
if(cpim.getHeader("Group-UUID")) {
//console.log("message is for a group");
return cpim.getHeader("group-uuid")
return cpim.getHeader("Group-UUID")
}
else if ((originalTo || messageFromUser) ) {
//console.log(`adding message to conversation between ${originalTo} and ${messageFromUser}.`)
Expand Down

0 comments on commit 5a43d07

Please sign in to comment.