Add utility functions for display of actors.
This commit is contained in:
parent
564d563547
commit
95c9c81da1
12
src/actor.js
12
src/actor.js
|
@ -33,6 +33,18 @@ Actor.prototype = {
|
|||
raw: undefined,
|
||||
valid: false,
|
||||
// Methods
|
||||
// Get the name used for display
|
||||
displayName: function() {
|
||||
if (this.info.display_name) {
|
||||
return this.info.display_name
|
||||
} else {
|
||||
return this.name
|
||||
}
|
||||
},
|
||||
// Get the address
|
||||
address: function() {
|
||||
return this.name + '@' + this.server
|
||||
},
|
||||
// Load from name@server.
|
||||
// Callback is a function accepting two arguments:
|
||||
// - a boolean indicating if the loading is complete or in failure,
|
||||
|
|
Loading…
Reference in New Issue