mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
receive message
This commit is contained in:
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/alasql@0.4"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
var data = [ {a: 11, b: 10}, {a: 2, b: 20}, {a: 1, b: 30} ];
|
||||||
|
|
||||||
|
var res = alasql('SELECT * FROM ? WHERE a = 1',[data]);
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var data= [
|
||||||
|
{a:{aa:10},b:{bb:2}},
|
||||||
|
{a:{aa:10},b:{bb:2}},
|
||||||
|
{a:{aa:2},b:{bb:2}},
|
||||||
|
{a:{aa:3},b:{bb:3}}
|
||||||
|
]
|
||||||
|
|
||||||
|
var res = alasql('SELECT a, b FROM ? WHERE b->bb = 2',[data]);
|
||||||
|
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
|
||||||
|
alasql(`CREATE TABLE Persons (
|
||||||
|
ID int NOT NULL PRIMARY KEY,
|
||||||
|
LastName varchar(255) NOT NULL,
|
||||||
|
FirstName varchar(255),
|
||||||
|
Age int,
|
||||||
|
jsn1 JSON(64000) CHARACTER SET LATIN
|
||||||
|
);`);
|
||||||
|
|
||||||
|
alasql("INSERT INTO Persons VALUES (100, 'maquiran', 'peter', 18)");
|
||||||
|
console.log(alasql("SELECT * FROM Persons "))
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -131,7 +131,7 @@ export class AuthService {
|
|||||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||||
|
|
||||||
this.autologout(10000);
|
// this.autologout(10000);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ export class RoomService {
|
|||||||
this.calDateDuration()
|
this.calDateDuration()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
isSenderIsNotMe(ChatMessage) {
|
||||||
|
return SessionStore.user.RochetChatUser != ChatMessage.u.username
|
||||||
|
}
|
||||||
|
|
||||||
receiveMessage() {
|
receiveMessage() {
|
||||||
|
|
||||||
this.WsChatService.updateRoomEventss(
|
this.WsChatService.updateRoomEventss(
|
||||||
@@ -84,7 +89,7 @@ export class RoomService {
|
|||||||
"stream-room-messages",
|
"stream-room-messages",
|
||||||
(ChatMessage) => {
|
(ChatMessage) => {
|
||||||
|
|
||||||
if(environment.chatOffline == false) {
|
if(environment.chatOffline == false || this.isSenderIsNotMe(ChatMessage)) {
|
||||||
ChatMessage = ChatMessage.fields.args[0]
|
ChatMessage = ChatMessage.fields.args[0]
|
||||||
ChatMessage = this.fix_updatedAt(ChatMessage)
|
ChatMessage = this.fix_updatedAt(ChatMessage)
|
||||||
console.log('recivemessage', ChatMessage)
|
console.log('recivemessage', ChatMessage)
|
||||||
@@ -99,14 +104,10 @@ export class RoomService {
|
|||||||
this.scrollDown()
|
this.scrollDown()
|
||||||
}, 100)
|
}, 100)
|
||||||
|
|
||||||
//this.sortService.sortDate(this.messages, '')
|
this.NativeNotificationService.sendNotificationChat({
|
||||||
|
message: message.msg,
|
||||||
if(SessionStore.user.RochetChatUser != ChatMessage.u.username) {
|
title: this.name
|
||||||
this.NativeNotificationService.sendNotificationChat({
|
});
|
||||||
message: message.msg,
|
|
||||||
title: this.name
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addMessageDB(ChatMessage)
|
this.addMessageDB(ChatMessage)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user