aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImpl.java
diff options
context:
space:
mode:
authorDanny van Heumen <danny@dannyvanheumen.nl>2014-12-18 00:28:46 +0100
committerDanny van Heumen <danny@dannyvanheumen.nl>2015-01-12 22:47:08 +0100
commitdb41fa2525d504ee927c203b5c2a203872a3b7cf (patch)
treee5ecde44d22a1f51900cd48be6c92b28055962b8 /src/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImpl.java
parent1d57442c0cdf5609f96912c000ac0f4e2799e1b8 (diff)
downloadjitsi-db41fa2525d504ee927c203b5c2a203872a3b7cf.zip
jitsi-db41fa2525d504ee927c203b5c2a203872a3b7cf.tar.gz
jitsi-db41fa2525d504ee927c203b5c2a203872a3b7cf.tar.bz2
Work-in-progress on MUC member presence.
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImpl.java')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImpl.java37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImpl.java b/src/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImpl.java
index 19a9472..66f9bd8 100644
--- a/src/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/irc/ChatRoomMemberIrcImpl.java
@@ -59,6 +59,11 @@ public class ChatRoomMemberIrcImpl
new TreeSet<ChatRoomMemberRole>();
/**
+ * Member's presence status in the chat room.
+ */
+ private IrcStatusEnum status;
+
+ /**
* Creates an instance of <tt>ChatRoomMemberIrcImpl</tt>, by specifying the
* protocol provider, the corresponding chat room, where this member is
* joined, the identifier of the contact (the nickname), the login, the
@@ -71,12 +76,14 @@ public class ChatRoomMemberIrcImpl
* @param ident ident of member
* @param hostname host name of member
* @param chatRoomMemberRole the role that this member has in the
+ * @param status current presence status
* corresponding chat room
*/
public ChatRoomMemberIrcImpl(
final ProtocolProviderServiceIrcImpl parentProvider,
final ChatRoom chatRoom, final String contactID, final String ident,
- final String hostname, final ChatRoomMemberRole chatRoomMemberRole)
+ final String hostname, final ChatRoomMemberRole chatRoomMemberRole,
+ final IrcStatusEnum status)
{
if (parentProvider == null)
{
@@ -110,6 +117,11 @@ public class ChatRoomMemberIrcImpl
throw new IllegalArgumentException("member role cannot be null");
}
this.roles.add(chatRoomMemberRole);
+ if (status == null)
+ {
+ throw new IllegalArgumentException("status cannot be null");
+ }
+ this.status = status;
}
/**
@@ -298,4 +310,27 @@ public class ChatRoomMemberIrcImpl
return false;
return true;
}
+
+ /**
+ * Return the chat room member's most recent presence status.
+ *
+ * @return returns the most recent presence status
+ */
+ @Override
+ public PresenceStatus getPresenceStatus()
+ {
+ return this.status;
+ }
+
+ /**
+ * Set a new presence status.
+ *
+ * @param status the new presence status
+ */
+ IrcStatusEnum setPresenceStatus(final IrcStatusEnum status)
+ {
+ final IrcStatusEnum previous = this.status;
+ this.status = status;
+ return previous;
+ }
}