-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH adding some more details about users rights
adding feature #18 as requested deprecating SlackBot class (it is now a user returning true to isBot) increasing version to release a java 7 bytecode compatible version. Change-Id: I99e8233e38eba2dc9b343ec3a2b6750e565163da
- Loading branch information
Benoit Corne
committed
Jul 27, 2015
1 parent
87d0414
commit 6a2977c
Showing
15 changed files
with
197 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.ullink.slack.simpleslackapi; | ||
|
||
@Deprecated | ||
public interface SlackBot extends SlackPersona | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
package com.ullink.slack.simpleslackapi; | ||
|
||
public interface SlackUser extends SlackPersona | ||
public interface SlackUser extends SlackPersona, SlackBot | ||
{ | ||
String getRealName(); | ||
String getUserMail(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
src/main/java/com/ullink/slack/simpleslackapi/impl/SlackPersonaImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package com.ullink.slack.simpleslackapi.impl; | ||
|
||
import com.ullink.slack.simpleslackapi.SlackPersona; | ||
|
||
class SlackPersonaImpl implements SlackPersona | ||
{ | ||
final String id; | ||
final String userName; | ||
final String realName; | ||
final String userMail; | ||
final boolean deleted; | ||
final boolean admin; | ||
final boolean owner; | ||
final boolean primaryOwner; | ||
final boolean restricted; | ||
final boolean ultraRestricted; | ||
final boolean bot; | ||
|
||
SlackPersonaImpl(String id, String userName, String realName, String userMail, boolean deleted, boolean admin, boolean owner, boolean primaryOwner, boolean restricted, boolean ultraRestricted, boolean bot) | ||
{ | ||
this.id = id; | ||
this.userName = userName; | ||
this.realName = realName; | ||
this.userMail = userMail; | ||
this.deleted = deleted; | ||
this.admin = admin; | ||
this.owner = owner; | ||
this.primaryOwner = primaryOwner; | ||
this.restricted = restricted; | ||
this.ultraRestricted = ultraRestricted; | ||
this.bot = bot; | ||
} | ||
|
||
@Override | ||
public String getId() | ||
{ | ||
return id; | ||
} | ||
|
||
@Override | ||
public String getUserName() | ||
{ | ||
return userName; | ||
} | ||
|
||
@Override | ||
public boolean isDeleted() | ||
{ | ||
return deleted; | ||
} | ||
|
||
@Override | ||
public boolean isAdmin() | ||
{ | ||
return admin; | ||
} | ||
|
||
@Override | ||
public boolean isOwner() | ||
{ | ||
return owner; | ||
} | ||
|
||
@Override | ||
public boolean isPrimaryOwner() | ||
{ | ||
return primaryOwner; | ||
} | ||
|
||
@Override | ||
public boolean isRestricted() | ||
{ | ||
return restricted; | ||
} | ||
|
||
@Override | ||
public boolean isUltraRestricted() | ||
{ | ||
return ultraRestricted; | ||
} | ||
|
||
@Override | ||
public boolean isBot() | ||
{ | ||
return bot; | ||
} | ||
|
||
@Override | ||
public String getUserMail() | ||
{ | ||
return userMail; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,15 +23,15 @@ public void connect() | |
channels.put("channelid4",new SlackChannelImpl("channelid4", "testchannel4", "topicchannel4", "topicchannel4", false)); | ||
channels.put("channelid5",new SlackChannelImpl("channelid5", "testchannel5", "topicchannel5", "topicchannel5", false)); | ||
|
||
users.put("userid1",new SlackUserImpl("userid1", "username1", "realname1","[email protected]", false)); | ||
users.put("userid2",new SlackUserImpl("userid2", "username2", "realname2","[email protected]", false)); | ||
users.put("userid3",new SlackUserImpl("userid3", "username3", "realname3","[email protected]", true)); | ||
users.put("userid4",new SlackUserImpl("userid4", "username4", "realname4","[email protected]", false)); | ||
users.put("userid5",new SlackUserImpl("userid5", "username5", "realname4","[email protected]", true)); | ||
|
||
bots.put("botid1",new SlackBotImpl("botid1", "botname1", false)); | ||
bots.put("botid2",new SlackBotImpl("botid2", "botname2", false)); | ||
bots.put("botid3",new SlackBotImpl("botid3", "botname2", true)); | ||
users.put("userid1",new SlackUserImpl("userid1", "username1", "realname1","[email protected]", false,false,false,false,false,false, false)); | ||
users.put("userid2",new SlackUserImpl("userid2", "username2", "realname2","[email protected]", false,false,false,false,false,false, false)); | ||
users.put("userid3",new SlackUserImpl("userid3", "username3", "realname3","[email protected]", true,false,false,false,false,false, false)); | ||
users.put("userid4",new SlackUserImpl("userid4", "username4", "realname4","[email protected]", false,false,false,false,false,false, false)); | ||
users.put("userid5",new SlackUserImpl("userid5", "username5", "realname4","[email protected]", true,false,false,false,false,false, false)); | ||
|
||
users.put("botid1",new SlackUserImpl("botid1", "botname1", "real bot name 1", null,false,false,false,false,false,false,true)); | ||
users.put("botid2",new SlackUserImpl("botid2", "botname2", "real bot name 2", null,false,false,false,false,false,false,true)); | ||
users.put("botid3",new SlackUserImpl("botid3", "botname3", "real bot name 3", null, true,false,false,false,false,false,true)); | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.