@chat21/chat21-ionic 3.0.68 → 3.0.70-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE +6 -657
- package/README.md +4 -2
- package/config.xml +2 -3
- package/package.json +5 -5
- package/resources/android/icon/drawable-hdpi-icon.png +0 -0
- package/resources/android/icon/drawable-ldpi-icon.png +0 -0
- package/resources/android/icon/drawable-mdpi-icon.png +0 -0
- package/resources/android/icon/drawable-xhdpi-icon.png +0 -0
- package/resources/android/icon/drawable-xxhdpi-icon.png +0 -0
- package/resources/android/icon/drawable-xxxhdpi-icon.png +0 -0
- package/resources/android/icon.png +0 -0
- package/resources/android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/android/splash.png +0 -0
- package/resources/android/xml/network_security_config.xml +6 -0
- package/resources/ios/icon/icon-1024.png +0 -0
- package/resources/ios/icon/icon-108@2x.png +0 -0
- package/resources/ios/icon/icon-20.png +0 -0
- package/resources/ios/icon/icon-20@2x.png +0 -0
- package/resources/ios/icon/icon-20@3x.png +0 -0
- package/resources/ios/icon/icon-24@2x.png +0 -0
- package/resources/ios/icon/icon-27.5@2x.png +0 -0
- package/resources/ios/icon/icon-29.png +0 -0
- package/resources/ios/icon/icon-29@2x.png +0 -0
- package/resources/ios/icon/icon-29@3x.png +0 -0
- package/resources/ios/icon/icon-40.png +0 -0
- package/resources/ios/icon/icon-40@2x.png +0 -0
- package/resources/ios/icon/icon-40@3x.png +0 -0
- package/resources/ios/icon/icon-44@2x.png +0 -0
- package/resources/ios/icon/icon-50.png +0 -0
- package/resources/ios/icon/icon-50@2x.png +0 -0
- package/resources/ios/icon/icon-60.png +0 -0
- package/resources/ios/icon/icon-60@2x.png +0 -0
- package/resources/ios/icon/icon-60@3x.png +0 -0
- package/resources/ios/icon/icon-72.png +0 -0
- package/resources/ios/icon/icon-72@2x.png +0 -0
- package/resources/ios/icon/icon-76.png +0 -0
- package/resources/ios/icon/icon-76@2x.png +0 -0
- package/resources/ios/icon/icon-83.5@2x.png +0 -0
- package/resources/ios/icon/icon-86@2x.png +0 -0
- package/resources/ios/icon/icon-98@2x.png +0 -0
- package/resources/ios/icon/icon@2x.png +0 -0
- package/resources/ios/icon.png +0 -0
- package/resources/ios/splash.jpg +0 -0
- package/resources/ios/splash.png +0 -0
- package/src/app/app.component.ts +16 -5
- package/src/app/components/conversation-info/info-content/info-content.component.ts +19 -19
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +22 -22
- package/src/app/pages/conversations-list/conversations-list.page.ts +34 -34
- package/src/app/pages/create-canned-response/create-canned-response.page.ts +19 -19
- package/src/chat-config-native-mqtt.json +3 -3
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +52 -39
|
@@ -109,6 +109,18 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
|
|
|
109
109
|
|
|
110
110
|
// }
|
|
111
111
|
|
|
112
|
+
getConversationsFromLocalStorage(){
|
|
113
|
+
let conversationsStored = []
|
|
114
|
+
if(localStorage.getItem('chat_sv5__conversations')){
|
|
115
|
+
conversationsStored = JSON.parse(localStorage.getItem('chat_sv5__conversations'))
|
|
116
|
+
if(conversationsStored && conversationsStored.length > 0) {
|
|
117
|
+
// this.conversationsHandlerService.conversations = conversationsStored
|
|
118
|
+
this.logger.log('[FIREBASEConversationsHandlerSERVICE] retrive conversations from storage --> ', conversationsStored.length)
|
|
119
|
+
this.conversations = conversationsStored
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
112
124
|
/**
|
|
113
125
|
* mi connetto al nodo conversations
|
|
114
126
|
* creo la reference
|
|
@@ -119,52 +131,53 @@ export class FirebaseConversationsHandler extends ConversationsHandlerService {
|
|
|
119
131
|
//----------------------------------------------------------------------------------
|
|
120
132
|
subscribeToConversations(lastConversationTimestamp: number, callback) {
|
|
121
133
|
const that = this;
|
|
134
|
+
this.getConversationsFromLocalStorage()
|
|
122
135
|
const urlNodeFirebase = conversationsPathForUserId(this.tenant, this.loggedUserId);
|
|
123
136
|
this.logger.debug('[FIREBASEConversationsHandlerSERVICE] SubscribeToConversations conversations::ACTIVE urlNodeFirebase', urlNodeFirebase)
|
|
124
137
|
this.ref = firebase.database().ref(urlNodeFirebase).orderByChild('timestamp').limitToLast(200);
|
|
125
138
|
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
this.ref.once('value').then(snapshot => {
|
|
140
|
+
this.conversations.splice(0) //empty conversations list and replace storedConversations with remote onces
|
|
141
|
+
if(snapshot && snapshot.val()){
|
|
128
142
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// }
|
|
143
|
+
snapshot.forEach(childSnapshot => {
|
|
144
|
+
// const childData: ConversationModel = childSnapshot.val();
|
|
145
|
+
// childData.uid = childSnapshot.key
|
|
146
|
+
// that.added(childData)
|
|
147
|
+
// lastConversationTimestamp = childData.timestamp
|
|
148
|
+
that.added(childSnapshot)
|
|
149
|
+
});
|
|
150
|
+
this.logger.debug('[FIREBASEConversationsHandlerSERVICE] # of remote conversations on Firebase:', Object.keys(snapshot.val()).length)
|
|
151
|
+
this.logger.debug('[FIREBASEConversationsHandlerSERVICE] # of conversation added:', that.conversations)
|
|
152
|
+
callback(that.conversations)
|
|
153
|
+
return lastConversationTimestamp
|
|
154
|
+
}
|
|
142
155
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
}).then(()=> {
|
|
157
|
+
this.ref.on('child_changed', (childSnapshot) => {
|
|
158
|
+
that.changed(childSnapshot);
|
|
159
|
+
});
|
|
160
|
+
this.ref.on('child_removed', (childSnapshot) => {
|
|
161
|
+
that.removed(childSnapshot);
|
|
162
|
+
});
|
|
163
|
+
this.ref.on('child_added', (childSnapshot) => {
|
|
164
|
+
that.added(childSnapshot);
|
|
165
|
+
});
|
|
166
|
+
})
|
|
154
167
|
|
|
155
|
-
this.ref.on('child_changed', (childSnapshot) => {
|
|
156
|
-
|
|
157
|
-
});
|
|
158
|
-
this.ref.on('child_removed', (childSnapshot) => {
|
|
159
|
-
|
|
160
|
-
});
|
|
161
|
-
this.ref.on('child_added', (childSnapshot) => {
|
|
162
|
-
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
setTimeout(() => {
|
|
166
|
-
|
|
167
|
-
}, 2000);
|
|
168
|
+
// this.ref.on('child_changed', (childSnapshot) => {
|
|
169
|
+
// that.changed(childSnapshot);
|
|
170
|
+
// });
|
|
171
|
+
// this.ref.on('child_removed', (childSnapshot) => {
|
|
172
|
+
// that.removed(childSnapshot);
|
|
173
|
+
// });
|
|
174
|
+
// this.ref.on('child_added', (childSnapshot) => {
|
|
175
|
+
// that.added(childSnapshot);
|
|
176
|
+
// });
|
|
177
|
+
|
|
178
|
+
// setTimeout(() => {
|
|
179
|
+
// callback()
|
|
180
|
+
// }, 2000);
|
|
168
181
|
}
|
|
169
182
|
|
|
170
183
|
public getLastConversation(callback: (conversation: ConversationModel, error: string)=>void){
|