This commit is contained in:
tiago.kayaya
2021-01-22 16:01:44 +01:00
95 changed files with 3733 additions and 8202 deletions
+85 -4
View File
@@ -56,9 +56,7 @@ export class ChatService {
});
} */
getAllDirectMessages(){
return this.http.get(environment.apiChatUrl+'im.list', this.options);
}
getAllChannels(){
return this.http.get(environment.apiChatUrl+'channels.list', this.options);
}
@@ -69,6 +67,13 @@ export class ChatService {
getAllRooms(){
return this.http.get(environment.apiChatUrl+'rooms.get', this.options);
}
customsRooms(params:any){
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'rooms.get', opts);
}
getAllPrivateGroups(){
return this.http.get(environment.apiChatUrl+'groups.list', this.options);
}
@@ -96,7 +101,9 @@ export class ChatService {
loadJoinedRooms(){
return this.http.get(environment.apiChatUrl+'im.list', this.options);
}
getAllDirectMessages(){
return this.http.get(environment.apiChatUrl+'im.list', this.options);
}
//Load messages from roomId
getRoomMessages(roomId:any){
@@ -147,5 +154,79 @@ export class ChatService {
}
return this.http.get(environment.apiChatUrl+'im.messages', opts);
}
/* GROUPS */
addGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.create', body, this.options);
}
getGroupMembers(roomId:string){
let params = new HttpParams();
let url=environment.apiChatUrl+'groups.members';
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(url, opts);
}
getChannelMembers(roomId:string){
let params = new HttpParams();
let url=environment.apiChatUrl+'channels.members';
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(url, opts);
}
/* GROUP MESSAGES */
getPrivateGroupMessages(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'groups.history', opts);
}
getPublicGroupMessages(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'channels.history', opts);
}
closeGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.close', body, this.options);
}
closeChannel(body:any){
return this.http.post(environment.apiChatUrl+'channels.close', body, this.options);
}
deleteGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.delete', body, this.options);
}
deleteChannel(body:any){
return this.http.post(environment.apiChatUrl+'channels.delete', body, this.options);
}
addUserToGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.invite', body, this.options);
}
getGroupInfo(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'groups.info', opts);
}
}