Skip to content

Commit

Permalink
Add default display name formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSaints committed May 29, 2016
1 parent 8702649 commit 03d03e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/skype.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ class Skype extends Adapter
@apiTimeout = 15000
@robot.logger.info "hubot-skype-bot: Adapter loaded."

_nameFromId: (userId) ->
parts = userId.split(":")
parts[parts.length - 1]

_createUser: (userId, roomId = false, displayName = "") ->
user = @robot.brain.userForId(userId)
user.room = roomId if roomId
user.name = displayName if displayName.length > 0
user.name = displayName
if displayName.length < 1
user.name = @_nameFromId(userId)
@robot.logger.info("hubot-skype-bot: new user : ", user)
user

Expand Down

0 comments on commit 03d03e1

Please sign in to comment.