Skip to content

Commit

Permalink
finish integration of upstream pressage
Browse files Browse the repository at this point in the history
  • Loading branch information
nanu-c committed Feb 13, 2023
1 parent 7fbac2a commit ce106a4
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 64 deletions.
16 changes: 7 additions & 9 deletions axolotl-web/src/components/LegacyHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="col-12">
<div
v-if="
isGroup &&
currentChat.isGroup &&
currentChat.title === currentChat.Tel
"
class="header-text-chat"
Expand All @@ -54,7 +54,7 @@
<div class="col-12">
<div
v-if="
isGroup &&
currentChat.isGroup &&
currentGroup !== null &&
typeof currentGroup !== 'undefined'
"
Expand All @@ -66,7 +66,7 @@
</div>
<div
v-if="
isGroup &&
currentChat.isGroup &&
currentGroup !== null &&
typeof currentGroup !== 'undefined'
"
Expand All @@ -78,7 +78,7 @@
</div>
<div
v-if="
!isGroup &&
!currentChat.isGroup &&
currentChat.title === currentChat.Tel
"
class="number-text"
Expand Down Expand Up @@ -112,7 +112,7 @@
<button
v-if="
currentChat !== null &&
!isGroup &&
!currentChat.isGroup &&
currentChat.title !== currentChat.Tel
"
class="dropdown-item"
Expand All @@ -139,7 +139,7 @@
<button
v-if="
currentChat !== null &&
!isGroup &&
!currentChat.isGroup &&
currentChat.title === currentChat.Tel
"
v-translate
Expand All @@ -151,7 +151,7 @@
<button
v-if="
currentChat !== null &&
!isGroup &&
!currentChat.isGroup &&
currentChat.title !== currentChat.Tel
"
v-translate
Expand Down Expand Up @@ -395,7 +395,6 @@ export default {
addContactModal: false,
editContactModal: false,
editContactId: -1,
isGroup: false,
};
},
computed: mapState([
Expand All @@ -418,7 +417,6 @@ export default {
handler() {
this.names = [];
this.showSettingsMenu = false;
this.isGroup = this.isGroupCheck(this.currentChat)
},
deep: true,
},
Expand Down
11 changes: 4 additions & 7 deletions axolotl-web/src/components/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</div>
<blockquote v-if="message.QuotedMessage">
<cite v-if="message.QuotedMessage && is_outgoing" v-translate>You</cite>
<cite v-else>{{ getName(message.QuotedMessage.SourceUUID) }}</cite>
<cite v-else>{{ name?name:getName(message.QuotedMessage.SourceUUID) }}</cite>
<p>{{ message.QuotedMessage.Message }}</p>
</blockquote>
<div v-if="message.Attachment !== ''" class="attachment">
Expand Down Expand Up @@ -210,10 +210,8 @@ export default {
if (this.senderName == "") {
const uuid = this.message.sender
const contact = this.contacts.find(function (element) {
console.log(element.address.uuid, uuid);
return element.address.uuid === uuid;
});
console.log(contact);
if (typeof contact !== "undefined") {
return contact.name;
}
Expand Down Expand Up @@ -246,7 +244,6 @@ export default {
};
}
}
this.getName(this.message.SourceUUID);
},
methods: {
sanitize(msg) {
Expand All @@ -273,12 +270,12 @@ export default {
}
},
getName() {
if(!this.isGroup) return "";
if (this.contacts !== null) {
const uuid = this.message.sender;
const contact = this.contacts.find(function (element) {
return element.address.uuid === uuid;
});
console.log(contact);
if (typeof contact !== "undefined") {
this.name = contact.name;
return this.name;
Expand All @@ -295,8 +292,8 @@ export default {
return this.name;
}
}
this.name = uuid;
return uuid;
this.name = this.message.sender;
return this.message.sender;
},
isAttachmentArray(input) {
try {
Expand Down
11 changes: 5 additions & 6 deletions axolotl-web/src/pages/ChatList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
<font-awesome-icon icon="times" />
</button>
</div>
<div v-for="chat in chatList" :key="chat.id" class="row">
<div v-for="chat in chatList" :key="chat.id.Contact?chat.id.Contact:chat.id.Group" class="row">
<!-- chat entry -->
<div
:id="chat.id"
:id="chat.id.Contact?chat.id.Contact:chat.id.Group"
:class="
editActive && selectedChat.indexOf(chat.id) >= 0
editActive && selectedChat.indexOf(chat.id.Contact?chat.id.Contact:chat.id.Group) >= 0
? 'selected col-12 chat-container'
: 'col-12 chat-container '
"
data-long-press-delay="500"
@click="enterChat(chat)"
@long-press="editChat(chat.id)"
@long-press="editChat(chat.id.Contact?chat.id.Contact:chat.id.Group)"
>
<div class="row chat-entry">
<div class="avatar col-2">
Expand Down Expand Up @@ -134,7 +134,6 @@ export default {
},
created() {},
mounted() {
this.$store.dispatch("getChatList");
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
this.$language.current = navigator.language || navigator.userLanguage;
Expand Down Expand Up @@ -195,7 +194,7 @@ export default {
enterChat(chat) {
if (!this.editActive) {
this.$store.dispatch("setCurrentChat", chat);
router.push("/chat/" + chat.id);
router.push(`/chat/${JSON.stringify(chat.id)}`);
} else {
this.selectedChat.push(chat.Tel);
}
Expand Down
1 change: 0 additions & 1 deletion axolotl-web/src/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ router.beforeEach((to, from, next) => {
function proceed(to, next) {
const registrationPages = ['/register', '/verify', '/password', '/pin', '/setUsername', '/qr', '/onboarding'];
const registrationStatus = store.state.registrationStatus;
console.log(registrationStatus)
//disable routes when registration is not finished yet
if (registrationStatus === null && !registrationPages.includes(to.path)) {
return next('/onboarding');
Expand Down
8 changes: 4 additions & 4 deletions axolotl-web/src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export default createStore({
request: message,
code: 200,
}));
this.dispatch("getChatList")
// this.dispatch("getChatList")
}, state.socket.heartBeatInterval);
},
SOCKET_ONCLOSE(state) {
Expand Down Expand Up @@ -426,8 +426,10 @@ export default createStore({
const messageSent = JSON.parse(messageData.data);
console.log("message_sent", messageSent);
this.commit("SET_MESSAGE_RECEIVED", messageSent.message);
} else if (messageData.response_type === "registration_done") {
this.commit("SET_REGISTRATION_STATUS", "registered");
router.push("/")
}

break;
default:
console.log("unkown message ", messageData, Object.keys(messageData)[0]);
Expand Down Expand Up @@ -498,8 +500,6 @@ export default createStore({
}
},
getMessageList(state, chatId) {
console.log("getMessageList2", chatId)

this.commit("CLEAR_MESSAGELIST");
if (this.state.socket.isConnected) {
const data = {
Expand Down
Loading

0 comments on commit ce106a4

Please sign in to comment.