Skip to content
Snippets Groups Projects
Unverified Commit 06335c2c authored by akwizgran's avatar akwizgran
Browse files

Truncate all messages to valid length before sending.

parent 9d2c56e7
No related branches found
No related tags found
No related merge requests found
Showing
with 88 additions and 133 deletions
......@@ -128,12 +128,7 @@ public class WriteBlogPostActivity extends BriarActivity
}
private void enableOrDisablePublishButton() {
int bodyLength =
StringUtils.toUtf8(input.getText().toString()).length;
if (bodyLength > 0 && bodyLength <= MAX_BLOG_POST_BODY_LENGTH)
input.setSendButtonEnabled(true);
else
input.setSendButtonEnabled(false);
input.setSendButtonEnabled(input.getText().length() > 0);
}
@Override
......@@ -142,6 +137,7 @@ public class WriteBlogPostActivity extends BriarActivity
input.setVisibility(GONE);
progressBar.setVisibility(VISIBLE);
body = StringUtils.truncateUtf8(body, MAX_BLOG_POST_BODY_LENGTH);
storePost(body);
}
......
......@@ -100,6 +100,7 @@ import static java.util.logging.Level.WARNING;
import static org.briarproject.android.contact.ConversationItem.IncomingItem;
import static org.briarproject.android.contact.ConversationItem.OutgoingItem;
import static org.briarproject.android.fragment.SettingsFragment.SETTINGS_NAMESPACE;
import static org.briarproject.api.messaging.MessagingConstants.MAX_PRIVATE_MESSAGE_BODY_LENGTH;
public class ConversationActivity extends BriarActivity
implements EventListener, IntroductionHandler, TextInputListener {
......@@ -656,6 +657,7 @@ public class ConversationActivity extends BriarActivity
public void onSendClick(String text) {
markMessagesRead();
if (text.equals("")) return;
text = StringUtils.truncateUtf8(text, MAX_PRIVATE_MESSAGE_BODY_LENGTH);
long timestamp = System.currentTimeMillis();
timestamp = Math.max(timestamp, getMinTimestampForNewMessage());
createMessage(StringUtils.toUtf8(text), timestamp);
......
......@@ -20,6 +20,7 @@ import org.briarproject.api.contact.ContactId;
import org.briarproject.api.contact.ContactManager;
import org.briarproject.api.db.DbException;
import org.briarproject.api.introduction.IntroductionManager;
import org.briarproject.util.StringUtils;
import java.util.logging.Logger;
......@@ -33,6 +34,7 @@ import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static android.widget.Toast.LENGTH_SHORT;
import static java.util.logging.Level.WARNING;
import static org.briarproject.api.introduction.IntroductionConstants.MAX_INTRODUCTION_MESSAGE_LENGTH;
public class IntroductionMessageFragment extends BaseFragment
implements TextInputView.TextInputListener {
......@@ -176,6 +178,7 @@ public class IntroductionMessageFragment extends BaseFragment
ui.message.setSendButtonEnabled(false);
String msg = ui.message.getText().toString();
msg = StringUtils.truncateUtf8(msg, MAX_INTRODUCTION_MESSAGE_LENGTH);
makeIntroduction(contact1, contact2, msg);
// don't wait for the introduction to be made before finishing activity
......
......@@ -15,6 +15,7 @@ import org.briarproject.api.blogs.BlogSharingManager;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.forum.ForumSharingManager;
import org.briarproject.api.sync.GroupId;
import org.briarproject.util.StringUtils;
import java.util.ArrayList;
import java.util.Collection;
......@@ -24,6 +25,7 @@ import javax.inject.Inject;
import static org.briarproject.android.sharing.ShareActivity.CONTACTS;
import static org.briarproject.android.sharing.ShareActivity.getContactsFromIds;
import static org.briarproject.api.sharing.SharingConstants.GROUP_ID;
import static org.briarproject.api.sharing.SharingConstants.MAX_INVITATION_MESSAGE_LENGTH;
abstract class ShareMessageFragment extends BaseFragment
implements TextInputListener {
......@@ -103,6 +105,7 @@ abstract class ShareMessageFragment extends BaseFragment
// disable button to prevent accidental double invitations
ui.message.setSendButtonEnabled(false);
msg = StringUtils.truncateUtf8(msg, MAX_INVITATION_MESSAGE_LENGTH);
share(msg);
// don't wait for the invitation to be made before finishing activity
......
......@@ -13,6 +13,9 @@ public interface BlogConstants {
/** The maximum length of a blog post's body in bytes. */
int MAX_BLOG_POST_BODY_LENGTH = MAX_MESSAGE_BODY_LENGTH - 1024;
/** The maximum length of a blog comment in bytes. */
int MAX_BLOG_COMMENT_LENGTH = MAX_BLOG_POST_BODY_LENGTH;
/** The internal name of personal blogs that are created automatically */
String PERSONAL_BLOG_NAME = "briar.PERSONAL_BLOG_NAME";
......
package org.briarproject.api.blogs;
import org.briarproject.api.contact.Contact;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.db.DbException;
import org.briarproject.api.sharing.InvitationItem;
import org.briarproject.api.sharing.InvitationMessage;
import org.briarproject.api.sharing.SharingManager;
import org.briarproject.api.sync.ClientId;
import org.briarproject.api.sync.GroupId;
import java.util.Collection;
public interface BlogSharingManager extends SharingManager<Blog> {
/**
* Returns the unique ID of the blog sharing client.
*/
ClientId getClientId();
/**
* Sends an invitation to share the given blog with the given contact
* and sends an optional message along with it.
*/
void sendInvitation(GroupId groupId, ContactId contactId,
String message) throws DbException;
/**
* Responds to a pending blog invitation
*/
void respondToInvitation(Blog b, Contact c, boolean accept)
throws DbException;
/**
* Returns all blogs sharing messages sent by the Contact
* identified by contactId.
*/
Collection<InvitationMessage> getInvitationMessages(
ContactId contactId) throws DbException;
/**
* Returns all blogs to which the user has been invited.
*/
Collection<InvitationItem> getInvitations() throws DbException;
/**
* Returns all contacts who are sharing the given blog with us.
*/
Collection<Contact> getSharedBy(GroupId g) throws DbException;
/**
* Returns the IDs of all contacts with whom the given blog is shared.
*/
Collection<Contact> getSharedWith(GroupId g) throws DbException;
/**
* Returns true if the blog not already shared and no invitation is open
*/
boolean canBeShared(GroupId g, Contact c) throws DbException;
}
package org.briarproject.api.forum;
import org.briarproject.api.contact.Contact;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.db.DbException;
import org.briarproject.api.sharing.InvitationItem;
import org.briarproject.api.sharing.InvitationMessage;
import org.briarproject.api.sharing.SharingManager;
import org.briarproject.api.sync.ClientId;
import org.briarproject.api.sync.GroupId;
import java.util.Collection;
public interface ForumSharingManager extends SharingManager<Forum> {
/** Returns the unique ID of the forum sharing client. */
ClientId getClientId();
/**
* Sends an invitation to share the given forum with the given contact
* and sends an optional message along with it.
*/
void sendInvitation(GroupId groupId, ContactId contactId,
String message) throws DbException;
/**
* Responds to a pending forum invitation
*/
void respondToInvitation(Forum f, Contact c, boolean accept)
throws DbException;
/**
* Returns all forum sharing messages sent by the Contact
* identified by contactId.
*/
Collection<InvitationMessage> getInvitationMessages(
ContactId contactId) throws DbException;
/** Returns all forums to which the user has been invited. */
Collection<InvitationItem> getInvitations() throws DbException;
/** Returns all contacts who are sharing the given forum with us. */
Collection<Contact> getSharedBy(GroupId g) throws DbException;
/** Returns the IDs of all contacts with whom the given forum is shared. */
Collection<Contact> getSharedWith(GroupId g) throws DbException;
/** Returns true if the forum not already shared and no invitation is open */
boolean canBeShared(GroupId g, Contact c) throws DbException;
}
package org.briarproject.api.introduction;
import static org.briarproject.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH;
public interface IntroductionConstants {
/* Protocol roles */
......@@ -30,8 +32,18 @@ public interface IntroductionConstants {
String SIGNATURE = "signature";
/* Validation Constants */
/**
* The length of the message authentication code in bytes.
*/
int MAC_LENGTH = 32;
/**
* The maximum length of the introducer's optional message to the
* introducees in UTF-8 bytes.
*/
int MAX_INTRODUCTION_MESSAGE_LENGTH = MAX_MESSAGE_BODY_LENGTH - 1024;
/* Introducer Local State Metadata */
String STATE = "state";
String ROLE = "role";
......
package org.briarproject.api.sharing;
import static org.briarproject.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH;
public interface SharingConstants {
/** The length of a sharing session's random salt in bytes. */
/**
* The length of a sharing session's random salt in bytes.
*/
int SHARING_SALT_LENGTH = 32;
/**
* The maximum length of the optional message from the inviter to the
* invitee in UTF-8 bytes.
*/
int MAX_INVITATION_MESSAGE_LENGTH = MAX_MESSAGE_BODY_LENGTH - 1204;
String CONTACT_ID = "contactId";
String GROUP_ID = "groupId";
String TO_BE_SHARED_BY_US = "toBeSharedByUs";
......
......@@ -11,15 +11,17 @@ import java.util.Collection;
public interface SharingManager<S extends Shareable> extends MessageTracker {
/** Returns the unique ID of the group sharing client. */
/**
* Returns the unique ID of the group sharing client.
*/
ClientId getClientId();
/**
* Sends an invitation to share the given shareable with the given contact
* Sends an invitation to share the given group with the given contact
* and sends an optional message along with it.
*/
void sendInvitation(GroupId groupId, ContactId contactId,
String message) throws DbException;
String message) throws DbException;
/**
* Responds to a pending group invitation
......@@ -28,22 +30,29 @@ public interface SharingManager<S extends Shareable> extends MessageTracker {
throws DbException;
/**
* Returns all group sharing messages sent by the Contact
* identified by contactId.
* Returns all group sharing messages sent by the given contact.
*/
Collection<InvitationMessage> getInvitationMessages(
ContactId contactId) throws DbException;
/** Returns all invitations to shareables. */
/**
* Returns all invitations to groups.
*/
Collection<InvitationItem> getInvitations() throws DbException;
/** Returns all contacts who are sharing the given group with us. */
/**
* Returns all contacts who are sharing the given group with us.
*/
Collection<Contact> getSharedBy(GroupId g) throws DbException;
/** Returns the IDs of all contacts with whom the given group is shared. */
/**
* Returns all contacts with whom the given group is shared.
*/
Collection<Contact> getSharedWith(GroupId g) throws DbException;
/** Returns true if the group not already shared and no invitation is open */
/**
* Returns true if the group not already shared and no invitation is open
*/
boolean canBeShared(GroupId g, Contact c) throws DbException;
}
......@@ -11,6 +11,7 @@ import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.Message;
import org.briarproject.api.sync.MessageId;
import org.briarproject.api.system.Clock;
import org.briarproject.util.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
......@@ -18,6 +19,7 @@ import java.security.GeneralSecurityException;
import javax.inject.Inject;
import static org.briarproject.api.blogs.BlogConstants.MAX_BLOG_COMMENT_LENGTH;
import static org.briarproject.api.blogs.BlogConstants.MAX_BLOG_POST_BODY_LENGTH;
import static org.briarproject.api.blogs.MessageType.COMMENT;
import static org.briarproject.api.blogs.MessageType.POST;
......@@ -42,7 +44,8 @@ class BlogPostFactoryImpl implements BlogPostFactory {
throws FormatException, GeneralSecurityException {
// Validate the arguments
if (body.length() > MAX_BLOG_POST_BODY_LENGTH)
int bodyLength = StringUtils.toUtf8(body).length;
if (bodyLength > MAX_BLOG_POST_BODY_LENGTH)
throw new IllegalArgumentException();
// Serialise the data to be signed
......@@ -62,6 +65,13 @@ class BlogPostFactoryImpl implements BlogPostFactory {
@Nullable String comment, MessageId pOriginalId, MessageId parentId)
throws FormatException, GeneralSecurityException {
if (comment != null) {
int commentLength = StringUtils.toUtf8(comment).length;
if (commentLength == 0) throw new IllegalArgumentException();
if (commentLength > MAX_BLOG_COMMENT_LENGTH)
throw new IllegalArgumentException();
}
long timestamp = clock.currentTimeMillis();
// Generate the signature
......
......@@ -40,6 +40,7 @@ import static org.briarproject.api.blogs.BlogConstants.KEY_READ;
import static org.briarproject.api.blogs.BlogConstants.KEY_TIMESTAMP;
import static org.briarproject.api.blogs.BlogConstants.KEY_TIME_RECEIVED;
import static org.briarproject.api.blogs.BlogConstants.KEY_TYPE;
import static org.briarproject.api.blogs.BlogConstants.MAX_BLOG_COMMENT_LENGTH;
import static org.briarproject.api.blogs.BlogConstants.MAX_BLOG_POST_BODY_LENGTH;
import static org.briarproject.api.blogs.MessageType.COMMENT;
import static org.briarproject.api.blogs.MessageType.POST;
......@@ -125,7 +126,7 @@ class BlogPostValidator extends BdfMessageValidator {
// Comment
String comment = body.getOptionalString(0);
checkLength(comment, 1, MAX_BLOG_POST_BODY_LENGTH);
checkLength(comment, 1, MAX_BLOG_COMMENT_LENGTH);
// parent_original_id
// The ID of a post or comment in this group or another group
......@@ -216,7 +217,7 @@ class BlogPostValidator extends BdfMessageValidator {
// Body of Wrapped Comment
String comment = body.getOptionalString(2);
checkLength(comment, 1, MAX_BLOG_POST_BODY_LENGTH);
checkLength(comment, 1, MAX_BLOG_COMMENT_LENGTH);
// c_parent_original_id
// Taken from the original comment
......
......@@ -484,10 +484,7 @@ class FeedManagerImpl implements FeedManager, Client, EventListener {
private String getPostBody(String text) {
text = clean(text, article);
byte[] textBytes = StringUtils.toUtf8(text);
if (textBytes.length <= MAX_BLOG_POST_BODY_LENGTH)
return text;
return StringUtils.fromUtf8(textBytes, 0, MAX_BLOG_POST_BODY_LENGTH);
return StringUtils.truncateUtf8(text, MAX_BLOG_POST_BODY_LENGTH);
}
/**
......
......@@ -31,6 +31,7 @@ import static org.briarproject.api.introduction.IntroductionConstants.CONTACT_ID
import static org.briarproject.api.introduction.IntroductionConstants.CONTACT_ID_2;
import static org.briarproject.api.introduction.IntroductionConstants.GROUP_ID_1;
import static org.briarproject.api.introduction.IntroductionConstants.GROUP_ID_2;
import static org.briarproject.api.introduction.IntroductionConstants.MAX_INTRODUCTION_MESSAGE_LENGTH;
import static org.briarproject.api.introduction.IntroductionConstants.MESSAGE_TIME;
import static org.briarproject.api.introduction.IntroductionConstants.MSG;
import static org.briarproject.api.introduction.IntroductionConstants.PUBLIC_KEY1;
......@@ -103,7 +104,7 @@ class IntroducerManager {
return d;
}
public void makeIntroduction(Transaction txn, Contact c1, Contact c2,
void makeIntroduction(Transaction txn, Contact c1, Contact c2,
String msg, long timestamp) throws DbException, FormatException {
// TODO check for existing session with those contacts?
......@@ -116,6 +117,9 @@ class IntroducerManager {
BdfDictionary localAction = new BdfDictionary();
localAction.put(TYPE, TYPE_REQUEST);
if (!StringUtils.isNullOrEmpty(msg)) {
int msgLength = StringUtils.toUtf8(msg).length;
if (msgLength > MAX_INTRODUCTION_MESSAGE_LENGTH)
throw new IllegalArgumentException();
localAction.put(MSG, msg);
}
localAction.put(PUBLIC_KEY1, c1.getAuthor().getPublicKey());
......
......@@ -21,6 +21,7 @@ import static org.briarproject.api.introduction.IntroductionConstants.E_PUBLIC_K
import static org.briarproject.api.introduction.IntroductionConstants.GROUP_ID;
import static org.briarproject.api.introduction.IntroductionConstants.MAC;
import static org.briarproject.api.introduction.IntroductionConstants.MAC_LENGTH;
import static org.briarproject.api.introduction.IntroductionConstants.MAX_INTRODUCTION_MESSAGE_LENGTH;
import static org.briarproject.api.introduction.IntroductionConstants.MESSAGE_ID;
import static org.briarproject.api.introduction.IntroductionConstants.MESSAGE_TIME;
import static org.briarproject.api.introduction.IntroductionConstants.MSG;
......@@ -37,7 +38,6 @@ import static org.briarproject.api.introduction.IntroductionConstants.TYPE_REQUE
import static org.briarproject.api.introduction.IntroductionConstants.TYPE_RESPONSE;
import static org.briarproject.api.properties.TransportPropertyConstants.MAX_PROPERTIES_PER_TRANSPORT;
import static org.briarproject.api.properties.TransportPropertyConstants.MAX_PROPERTY_LENGTH;
import static org.briarproject.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH;
class IntroductionValidator extends BdfMessageValidator {
......@@ -92,7 +92,7 @@ class IntroductionValidator extends BdfMessageValidator {
String msg = null;
if (message.size() == 5) {
msg = message.getString(4);
checkLength(msg, 0, MAX_MESSAGE_BODY_LENGTH);
checkLength(msg, 0, MAX_INTRODUCTION_MESSAGE_LENGTH);
}
// Return the metadata
......
......@@ -204,6 +204,7 @@ class BlogSharingManagerImpl extends
.createBlog(msg.getBlogTitle(), msg.getBlogDesc(), author);
}
@Override
public Blog parse(BlogInviteeSessionState state) {
Author author = authorFactory
.createAuthor(state.getBlogAuthorName(),
......
......@@ -16,14 +16,15 @@ import javax.inject.Inject;
import static org.briarproject.api.blogs.BlogConstants.BLOG_AUTHOR_NAME;
import static org.briarproject.api.blogs.BlogConstants.BLOG_DESC;
import static org.briarproject.api.blogs.BlogConstants.BLOG_TITLE;
import static org.briarproject.api.blogs.BlogConstants.BLOG_PUBLIC_KEY;
import static org.briarproject.api.blogs.BlogConstants.BLOG_TITLE;
import static org.briarproject.api.blogs.BlogConstants.MAX_BLOG_DESC_LENGTH;
import static org.briarproject.api.blogs.BlogConstants.MAX_BLOG_TITLE_LENGTH;
import static org.briarproject.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
import static org.briarproject.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
import static org.briarproject.api.sharing.SharingConstants.INVITATION_MSG;
import static org.briarproject.api.sharing.SharingConstants.LOCAL;
import static org.briarproject.api.sharing.SharingConstants.MAX_INVITATION_MESSAGE_LENGTH;
import static org.briarproject.api.sharing.SharingConstants.SESSION_ID;
import static org.briarproject.api.sharing.SharingConstants.SHARE_MSG_TYPE_ABORT;
import static org.briarproject.api.sharing.SharingConstants.SHARE_MSG_TYPE_ACCEPT;
......@@ -32,7 +33,6 @@ import static org.briarproject.api.sharing.SharingConstants.SHARE_MSG_TYPE_INVIT
import static org.briarproject.api.sharing.SharingConstants.SHARE_MSG_TYPE_LEAVE;
import static org.briarproject.api.sharing.SharingConstants.TIME;
import static org.briarproject.api.sharing.SharingConstants.TYPE;
import static org.briarproject.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH;
class BlogSharingValidator extends BdfMessageValidator {
......@@ -76,7 +76,7 @@ class BlogSharingValidator extends BdfMessageValidator {
if (body.size() > 5) {
String msg = body.getString(5);
checkLength(msg, 0, MAX_MESSAGE_BODY_LENGTH);
checkLength(msg, 0, MAX_INVITATION_MESSAGE_LENGTH);
d.put(INVITATION_MSG, msg);
}
} else {
......
......@@ -167,6 +167,7 @@ class ForumSharingManagerImpl extends
.createForum(msg.getForumName(), msg.getForumSalt());
}
@Override
public Forum parse(ForumInviteeSessionState state) {
return forumFactory
.createForum(state.getForumName(), state.getForumSalt());
......
package org.briarproject.sharing;
import org.briarproject.api.FormatException;
import org.briarproject.api.clients.BdfMessageContext;
import org.briarproject.api.clients.ClientHelper;
import org.briarproject.api.clients.SessionId;
import org.briarproject.api.clients.BdfMessageContext;
import org.briarproject.api.data.BdfDictionary;
import org.briarproject.api.data.BdfList;
import org.briarproject.api.data.MetadataEncoder;
......@@ -20,6 +20,7 @@ import static org.briarproject.api.forum.ForumConstants.FORUM_SALT_LENGTH;
import static org.briarproject.api.forum.ForumConstants.MAX_FORUM_NAME_LENGTH;
import static org.briarproject.api.sharing.SharingConstants.INVITATION_MSG;
import static org.briarproject.api.sharing.SharingConstants.LOCAL;
import static org.briarproject.api.sharing.SharingConstants.MAX_INVITATION_MESSAGE_LENGTH;
import static org.briarproject.api.sharing.SharingConstants.SESSION_ID;
import static org.briarproject.api.sharing.SharingConstants.SHARE_MSG_TYPE_ABORT;
import static org.briarproject.api.sharing.SharingConstants.SHARE_MSG_TYPE_ACCEPT;
......@@ -28,7 +29,6 @@ import static org.briarproject.api.sharing.SharingConstants.SHARE_MSG_TYPE_INVIT
import static org.briarproject.api.sharing.SharingConstants.SHARE_MSG_TYPE_LEAVE;
import static org.briarproject.api.sharing.SharingConstants.TIME;
import static org.briarproject.api.sharing.SharingConstants.TYPE;
import static org.briarproject.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH;
class ForumSharingValidator extends BdfMessageValidator {
......@@ -61,7 +61,7 @@ class ForumSharingValidator extends BdfMessageValidator {
if (body.size() > 4) {
String msg = body.getString(4);
checkLength(msg, 0, MAX_MESSAGE_BODY_LENGTH);
checkLength(msg, 0, MAX_INVITATION_MESSAGE_LENGTH);
d.put(INVITATION_MSG, msg);
}
} else {
......
......@@ -29,7 +29,6 @@ import org.briarproject.api.sharing.InvitationItem;
import org.briarproject.api.sharing.InvitationMessage;
import org.briarproject.api.sharing.Shareable;
import org.briarproject.api.sharing.SharingManager;
import org.briarproject.api.sync.ClientId;
import org.briarproject.api.sync.Group;
import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.Message;
......@@ -58,6 +57,7 @@ import static org.briarproject.api.clients.ProtocolEngine.StateUpdate;
import static org.briarproject.api.sharing.SharingConstants.CONTACT_ID;
import static org.briarproject.api.sharing.SharingConstants.IS_SHARER;
import static org.briarproject.api.sharing.SharingConstants.LOCAL;
import static org.briarproject.api.sharing.SharingConstants.MAX_INVITATION_MESSAGE_LENGTH;
import static org.briarproject.api.sharing.SharingConstants.SESSION_ID;
import static org.briarproject.api.sharing.SharingConstants.SHAREABLE_ID;
import static org.briarproject.api.sharing.SharingConstants.SHARED_BY_US;
......@@ -115,8 +115,6 @@ abstract class SharingManagerImpl<S extends Shareable, I extends Invitation, IS
localGroup = contactGroupFactory.createLocalGroup(getClientId());
}
public abstract ClientId getClientId();
protected abstract InvitationMessage createInvitationRequest(MessageId id,
I msg, ContactId contactId, boolean available, long time,
boolean local, boolean sent, boolean seen, boolean read);
......@@ -282,6 +280,9 @@ abstract class SharingManagerImpl<S extends Shareable, I extends Invitation, IS
// add invitation message to local state to be available for engine
if (!StringUtils.isNullOrEmpty(msg)) {
int msgLength = StringUtils.toUtf8(msg).length;
if (msgLength > MAX_INVITATION_MESSAGE_LENGTH)
throw new IllegalArgumentException();
localState.setMessage(msg);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment