提交 7f19bc2f 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

readonly id in constructor

上级 3bb39af0
......@@ -257,19 +257,15 @@ export class Contact extends Accessory implements Sayable {
*/
protected payload?: ContactPayload
public readonly id: string // Contact Id
/**
* @private
*/
constructor (
id: string,
public readonly id: string,
) {
super()
log.silly('Contact', `constructor(${id})`)
this.id = id
// tslint:disable-next-line:variable-name
const MyClass = instanceToClass(this, Contact)
......
......@@ -114,42 +114,6 @@ export class Friendship extends Accessory implements Acceptable {
throw new Error('to be implemented')
}
// public static createConfirm(
// contactId: string,
// ): FriendRequestPayload {
// log.verbose('Friendship', 'createConfirm(%s)',
// contactId,
// )
// const payload: FriendRequestPayloadConfirm = {
// type : FriendRequestType.Confirm,
// contactId,
// }
// return payload
// }
// public static createReceive(
// contactId : string,
// hello : string,
// ticket : string,
// ): FriendRequestPayload {
// log.verbose('Friendship', 'createReceive(%s, %s, %s)',
// contactId,
// hello,
// ticket,
// )
// const payload: FriendRequestPayloadReceive = {
// type : FriendRequestType.Receive,
// contactId,
// hello,
// ticket,
// }
// return payload
// }
/**
*
* Instance Properties
......@@ -162,7 +126,7 @@ export class Friendship extends Accessory implements Acceptable {
protected payload?: FriendshipPayload
constructor (
public id: string,
public readonly id: string,
) {
super()
log.verbose('Friendship', 'constructor(id=%s)', id)
......
......@@ -55,7 +55,7 @@ export class RoomInvitation extends Accessory implements Acceptable {
*
*/
constructor (
public id: string,
public readonly id: string,
) {
super()
log.verbose('RoomInvitation', 'constructor(id=%s)', id)
......
......@@ -269,19 +269,15 @@ export class Room extends Accessory implements Sayable {
*/
protected payload?: RoomPayload
public readonly id: string // Room Id
/**
* @private
*/
constructor (
id: string,
public readonly id: string,
) {
super()
log.silly('Room', `constructor(${id})`)
this.id = id
// tslint:disable-next-line:variable-name
const MyClass = instanceToClass(this, Room)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册