2019-11-08 13:35:39 +09:00
|
|
|
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
|
|
|
|
|
|
|
|
import { UserInfo } from '@ucap-webmessenger/protocol-sync';
|
|
|
|
import {
|
|
|
|
UserInfoSS,
|
|
|
|
UserInfoF,
|
|
|
|
UserInfoDN
|
|
|
|
} from '@ucap-webmessenger/protocol-query';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'ucap-profile-profile',
|
|
|
|
templateUrl: './profile.component.html',
|
|
|
|
styleUrls: ['./profile.component.scss']
|
|
|
|
})
|
|
|
|
export class ProfileComponent implements OnInit {
|
|
|
|
@Input()
|
|
|
|
profileImageRoot: string;
|
|
|
|
@Input()
|
|
|
|
isMe: boolean;
|
|
|
|
@Input()
|
|
|
|
isBuddy: boolean;
|
|
|
|
@Input()
|
|
|
|
isFavorit: boolean;
|
|
|
|
@Input()
|
2019-11-20 14:57:54 +09:00
|
|
|
userInfo: UserInfo | UserInfoF;
|
2019-11-08 13:35:39 +09:00
|
|
|
|
|
|
|
@Output()
|
2019-11-20 14:57:54 +09:00
|
|
|
openChat = new EventEmitter<UserInfo | UserInfoF>();
|
|
|
|
@Output()
|
|
|
|
toggleFavorit = new EventEmitter<{
|
|
|
|
userInfo: UserInfo | UserInfoF;
|
|
|
|
isFavorit: boolean;
|
|
|
|
}>();
|
|
|
|
@Output()
|
|
|
|
toggleBuddy = new EventEmitter<{
|
|
|
|
userInfo: UserInfo | UserInfoF;
|
|
|
|
isBuddy: boolean;
|
|
|
|
}>();
|
2019-11-08 13:35:39 +09:00
|
|
|
|
|
|
|
constructor() {}
|
|
|
|
|
|
|
|
ngOnInit() {}
|
|
|
|
|
|
|
|
onClickOpenChat() {
|
|
|
|
this.openChat.emit(this.userInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
onClickCall() {}
|
|
|
|
|
|
|
|
onClickVideoConference() {}
|
|
|
|
|
|
|
|
onClickMessage() {}
|
2019-11-20 14:57:54 +09:00
|
|
|
|
|
|
|
onToggleFavorit() {
|
|
|
|
this.isFavorit = !this.isFavorit;
|
|
|
|
|
|
|
|
this.toggleFavorit.emit({
|
|
|
|
userInfo: this.userInfo,
|
|
|
|
isFavorit: this.isFavorit
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
onClickAddBuddy() {
|
|
|
|
this.toggleBuddy.emit({
|
|
|
|
userInfo: this.userInfo,
|
|
|
|
isBuddy: true
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
onClickDelBuddy() {
|
|
|
|
this.toggleBuddy.emit({
|
|
|
|
userInfo: this.userInfo,
|
|
|
|
isBuddy: false
|
|
|
|
});
|
|
|
|
}
|
2019-11-08 13:35:39 +09:00
|
|
|
}
|