This commit is contained in:
tiago.kayaya
2021-10-04 13:49:35 +01:00
parent e8bcf71b1a
commit 3f99ea222c
5 changed files with 28 additions and 27 deletions
+18
View File
@@ -9,6 +9,7 @@ import { Storage } from '@ionic/storage';
import { Message } from 'src/app/models/message.model';
import { Observable, Subject } from "rxjs/Rx";
import { WebsocketService } from './websocket.service';
import { FileService } from './functions/file.service';
@Injectable({
providedIn: 'root'
@@ -31,6 +32,7 @@ export class ChatService {
private authService: AuthService,
private storage: Storage,
private storageService:StorageService,
private fileService: FileService,
//private wsService: WebsocketService,
)
{
@@ -49,6 +51,22 @@ export class ChatService {
}); */
}
getDocumentDetails(url:string){
let headersc = new HttpHeaders();
headersc = headersc.set('X-User-Id', this.loggedUserChat['data'].userId);
headersc = headersc.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
// headersc = headersc.set("Host", "www.tabularium.pt");
// headersc = headersc.set("Origin", "http://localhost:8100");
// headersc = headersc.set("Referer", "http://localhost:8100/");
let optionsc = {
headers: headersc,
};
let fullUrl = "https://www.tabularium.pt/" + url;
return this.http.get(fullUrl, optionsc).subscribe(()=>{
this.fileService.viewDocumentByUrl(url)
});
}
getAllChannels(){
return this.http.get(environment.apiChatUrl+'channels.list', this.options);
}