Remove relevant console log,

This commit is contained in:
Eudes Inácio
2022-04-28 09:32:27 +01:00
parent 3021e8b0e1
commit 2826cea9df
153 changed files with 1001 additions and 1132 deletions
+12 -12
View File
@@ -32,7 +32,7 @@ export class ChatStorageService {
})
this.storage.set('chatmsg' + roomId, messages).then((value) => {
// console.log('MSG SAVED ON STORAGE', value)
//
});
})
@@ -66,7 +66,7 @@ export class ChatStorageService {
await this.storage.set('chatmsg' + roomId, messages)
} else {
// console.log('failed to update', identificator, ':',ChatMessage)
//
}
})
@@ -101,14 +101,14 @@ export class ChatStorageService {
messages[index] = Object.assign(messages[index], ChatMessage)
// if(messages[index].msg.includes('***********')) {
// console.log('storage update')
// console.log(JSON.stringify(messages[index]))
// console.log(JSON.stringify(ChatMessage))
//
//
//
// }
await this.storage.set('chatmsg' + roomId, messages)
} else {
console.log('failed to update', identificator)
}
})
@@ -130,10 +130,10 @@ export class ChatStorageService {
delete ChatMessage.temporaryData
messages.push(ChatMessage)
console.log('no ID')
await this.storage.set('chatmsg' + roomId, messages)
// console.log('add to DB', ChatMessage)
//
} else {
const find = messages.find((message)=> {
@@ -144,9 +144,9 @@ export class ChatStorageService {
delete ChatMessage.temporaryData
messages.push(ChatMessage)
await this.storage.set('chatmsg' + roomId, messages)
// console.log('add to DB', ChatMessage)
//
} else {
console.log('duplicate')
}
}
@@ -166,7 +166,7 @@ export class ChatStorageService {
delete ChatMessage.temporaryData
messages.push(ChatMessage)
// console.log('add to DB')
//
} else {
const find = messages.find((message)=> {
@@ -176,7 +176,7 @@ export class ChatStorageService {
if(!find) {
delete ChatMessage.temporaryData
messages.push(ChatMessage)
// console.log('add to DB')
//
}
+3 -3
View File
@@ -242,14 +242,14 @@ export class MessageService {
} else if (this.file.type != "application/img") {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
console.log(downloadFile)
} /* else if (this.file.type == 'application/audio') {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
} else if (this.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
} */
console.log('Download file ',downloadFile )
this.attachments[0] = {
image_url: downloadFile,
@@ -331,7 +331,7 @@ export class MessageService {
async save() {
const message = this.getChatObj()
console.log(message);
await MessageModel.update(message)
+5 -5
View File
@@ -242,12 +242,12 @@ export class RoomService {
if (typeof args[1] != 'object') {
this.userThatIsTyping = this.usernameToDisplayName(args[0])
console.log(this.userThatIsTyping, 'this.userThatIsTyping')
this.isTyping = args[1]
this.otherUserType = args[1]
this.readAllMessage()
// console.log(JSON.stringify(args))
//
// alert(JSON.stringify(args))
} else if(args[0]?.method == 'viewMessage' || args[1]?.method == 'viewMessage') {
@@ -255,7 +255,7 @@ export class RoomService {
} else if(args[0]?.method == 'deleteMessage' || args[1]?.method == 'deleteMessage') {
// alert('delete')
// console.log(args[0], 'receive delete message::()')
//
this.deleteMessage(args[1]?.method?._id)
} else {
@@ -395,7 +395,7 @@ export class RoomService {
return true
} else {
// console.log(_id,'==',this.messages[i]?._id, false)
//
}
}
@@ -612,7 +612,7 @@ export class RoomService {
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
// console.log('load chatHistory', JSON.stringify(chatHistory))
//
const messagesId = this.messages.map((message)=> message._id)
+1 -1
View File
@@ -13,7 +13,7 @@ export class WebsocketService {
public connect(url): Rx.Subject<MessageEvent> {
if(!this.subject){
this.subject = this.create(url);
console.log("Sucessful connect :"+url);
}
return this.subject;
}
@@ -152,7 +152,7 @@ export class WsChatMethodsService {
try {
const rooms = await this.storage.get('Rooms');
console.log('restore',rooms)
if(rooms) {
await rooms.result.update.forEach( async (roomData: room) => {
@@ -172,7 +172,7 @@ export class WsChatMethodsService {
async getAllRooms () {
this.loadingWholeList = true
const rooms = await this.WsChatService.getRooms();
console.log('get all rooms', this.loggedUser)
await this.storage.remove('Rooms');
await rooms.result.update.forEach( async (roomData: room, index) => {
@@ -210,7 +210,7 @@ export class WsChatMethodsService {
});
console.log('save rooms', rooms)
await this.storage.set('Rooms', rooms);
@@ -249,7 +249,7 @@ export class WsChatMethodsService {
}
this.WsChatService.streamNotifyLogged().then((subscription=>{
console.log('streamRoomMessages', subscription)
}))
}
@@ -275,14 +275,14 @@ export class WsChatMethodsService {
*/
private defaultSubtribe(id: any) {
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
//console.log('streamRoomMessages', subscription)
//
})
this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false)
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
//console.log('streamNotifyRoomDeleteMessage', subscription);
//
})
}
+22 -22
View File
@@ -54,7 +54,7 @@ export class WsChatService {
}
const requestId = uuidv4()
// console.log('Login true', SessionStore.user)
//
const message = {
msg: "method",
method: "login",
@@ -70,12 +70,12 @@ export class WsChatService {
return new Promise((resolve, reject) => {
// console.log('MESSAGE:ID', requestId)
//
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
// console.log('MESSAGE:ID', message)
//
if(message.id == requestId ) { // same request send
// console.log('MESSAGE:ID', message.id, requestId)
// console.log('LOGIN WS',message)
//
//
if(message.result) {
if(message.result.token) {
@@ -87,11 +87,11 @@ export class WsChatService {
}, 10)
resolve(message)
// console.log('LOGIN WS',message)
//
}
} else {
this.isLogin = false
// console.log('Register FAIl', message)
//
reject(message)
}
@@ -121,7 +121,7 @@ export class WsChatService {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId) { // same request send
resolve(message)
// console.log('getRooms', message)
//
return true
}
}})
@@ -206,7 +206,7 @@ export class WsChatService {
}]
}
// console.log('send message to rocketchat ', message)
//
this.ws.send({message, requestId});
@@ -312,7 +312,7 @@ export class WsChatService {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send
resolve(message)
// console.log(message);
//
return true
}
@@ -478,7 +478,7 @@ export class WsChatService {
return new Promise<chatHistory>((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
// console.log(message)
//
if(message.id == requestId ) { // same request send
resolve(message)
return true
@@ -536,7 +536,7 @@ export class WsChatService {
this.ws.registerCallback({
type:'Onmessage',
funx:(message)=>{
//console.log(message);
//
if(message.msg =='changed' && message.collection == collection) {
if(message.fields.args[0].rid == roomId) {
@@ -674,7 +674,7 @@ export class WsChatService {
registerCallback:(params: wsCallbacksParams) => {
let id = params.requestId || params.key || uuidv4()
// console.log('register id', params)
//
this.wsCallbacks[id] = params
this.n++
return id
@@ -690,7 +690,7 @@ export class WsChatService {
onopen: async ()=> {
this.ws.connected = true
console.log('================== welcome to socket server =====================')
setTimeout(()=>{
@@ -719,11 +719,11 @@ export class WsChatService {
for (const [key, item] of Object.entries(this.wsMsgQueue)) {
if(item.loginRequired == true && this.isLogin == true) {
//console.log('run msgQueue ', key)
//
this.ws.send(item);
delete this.wsMsgQueue[key]
} else if(item.loginRequired == false) {
//console.log('run msgQueue ', key)
//
this.ws.send(item);
delete this.wsMsgQueue[key]
}
@@ -732,13 +732,13 @@ export class WsChatService {
send: ({message, requestId = uuidv4(), loginRequired = true}:send) => {
if (this.ws.connected == false || loginRequired == true && this.isLogin == false) { // save data to send when back online
// console.log('save msgQueue this.ws.connected == false || loginRequired == true && this.isLogin == false',this.ws.connected, loginRequired, this.isLogin)
//console.log('save msgQueue', requestId, message)
//
//
this.wsMsgQueue[requestId] = {message, requestId, loginRequired}
} else {
let messageStr = JSON.stringify(message)
// console.log('messageStr', messageStr)
//
this.socket.send(messageStr)
}
@@ -748,7 +748,7 @@ export class WsChatService {
onmessage: async (event: any)=> {
const data = JSON.parse(event.data)
// console.log('onmessage', data)
//
for (const [key, value] of Object.entries(this.wsCallbacks)) {
if(value.type== 'Onmessage') {
@@ -772,11 +772,11 @@ export class WsChatService {
this.connect()
this.login()
console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
},
onerror: (event: any) => {
console.log(`[error] ${event.message}`);
}
}}