chat4app-client-angular 1.0.8 → 1.0.9
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/bundles/chat4app-client-angular.umd.js +21 -5
- package/bundles/chat4app-client-angular.umd.js.map +1 -1
- package/bundles/chat4app-client-angular.umd.min.js +1 -1
- package/bundles/chat4app-client-angular.umd.min.js.map +1 -1
- package/chat4app-client-angular.metadata.json +1 -1
- package/esm2015/lib/chat4app-client-angular.service.js +22 -6
- package/fesm2015/chat4app-client-angular.js +21 -5
- package/fesm2015/chat4app-client-angular.js.map +1 -1
- package/lib/chat4app-client-angular.service.d.ts +1 -0
- package/lib/chat4app-client-angular.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2041,19 +2041,19 @@
|
|
|
2041
2041
|
});
|
|
2042
2042
|
};
|
|
2043
2043
|
Chat4appClientAngularService.prototype.createGroup = function (group) {
|
|
2044
|
-
var url = this.chatUrl + "
|
|
2044
|
+
var url = this.chatUrl + "group";
|
|
2045
2045
|
return this.http.post(url, group, {
|
|
2046
2046
|
headers: new i1.HttpHeaders().set('Authorization', this.getBearerToken())
|
|
2047
2047
|
});
|
|
2048
2048
|
};
|
|
2049
2049
|
Chat4appClientAngularService.prototype.getGroup = function (chatId, groupId) {
|
|
2050
|
-
var url = this.chatUrl + "
|
|
2050
|
+
var url = this.chatUrl + "group/" + groupId + "/" + chatId;
|
|
2051
2051
|
return this.http.get(url, {
|
|
2052
2052
|
headers: new i1.HttpHeaders().set('Authorization', this.getBearerToken())
|
|
2053
2053
|
});
|
|
2054
2054
|
};
|
|
2055
2055
|
Chat4appClientAngularService.prototype.listGroups = function (chatId, externalId) {
|
|
2056
|
-
var url = this.chatUrl + "
|
|
2056
|
+
var url = this.chatUrl + "group/";
|
|
2057
2057
|
if (chatId && chatId.length > 0) {
|
|
2058
2058
|
url += "&chatId=" + chatId;
|
|
2059
2059
|
}
|
|
@@ -2065,7 +2065,7 @@
|
|
|
2065
2065
|
});
|
|
2066
2066
|
};
|
|
2067
2067
|
Chat4appClientAngularService.prototype.listFilesGroup = function (chatId, groupId) {
|
|
2068
|
-
var url = this.chatUrl + "
|
|
2068
|
+
var url = this.chatUrl + "group/" + chatId;
|
|
2069
2069
|
if (groupId && groupId.length > 0) {
|
|
2070
2070
|
url += "&groupId=" + chatId;
|
|
2071
2071
|
}
|
|
@@ -2073,6 +2073,12 @@
|
|
|
2073
2073
|
headers: new i1.HttpHeaders().set('Authorization', this.getBearerToken())
|
|
2074
2074
|
});
|
|
2075
2075
|
};
|
|
2076
|
+
Chat4appClientAngularService.prototype.event = function (eventName, chatUserExternalId) {
|
|
2077
|
+
var url = this.chatUrl + "event/" + eventName + "?chatUserExternalId=" + chatUserExternalId;
|
|
2078
|
+
return this.http.put(url, null, {
|
|
2079
|
+
headers: new i1.HttpHeaders().set('Authorization', this.getBearerToken())
|
|
2080
|
+
});
|
|
2081
|
+
};
|
|
2076
2082
|
/* Token */
|
|
2077
2083
|
Chat4appClientAngularService.prototype.getBearerToken = function () {
|
|
2078
2084
|
var ret = "Bearer " + window.sessionStorage.getItem("chat4AppSessionToken");
|
|
@@ -2211,6 +2217,8 @@
|
|
|
2211
2217
|
chatCallback.onChatClosed(chat4appMessage);
|
|
2212
2218
|
}
|
|
2213
2219
|
else if (data.type == "count_notread") {
|
|
2220
|
+
console.log("count_notread");
|
|
2221
|
+
console.log(data);
|
|
2214
2222
|
var chat4appMessage = new Chat4AppMessageReceive();
|
|
2215
2223
|
chat4appMessage.data.chatId = data.chatId;
|
|
2216
2224
|
chat4appMessage.data.chatMessageId = data.chatMessageId;
|
|
@@ -2381,7 +2389,15 @@
|
|
|
2381
2389
|
if (that.debug) {
|
|
2382
2390
|
console.log("publish chat4app.user.online " + userId + " ");
|
|
2383
2391
|
}
|
|
2384
|
-
|
|
2392
|
+
try {
|
|
2393
|
+
that.nc.publish("chat4app.user.online", userId);
|
|
2394
|
+
}
|
|
2395
|
+
catch (e) {
|
|
2396
|
+
if (_this.debug) {
|
|
2397
|
+
console.log("try reconnect...");
|
|
2398
|
+
}
|
|
2399
|
+
_this.ensureConn(userId);
|
|
2400
|
+
}
|
|
2385
2401
|
}, 1000);
|
|
2386
2402
|
if (this.debug) {
|
|
2387
2403
|
console.log("Subscribe online chat4app.user." + userId + ".online");
|