File tree Expand file tree Collapse file tree
src/main/java/org/buddycloud/channelserver/channel/node/configuration/field Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,8 +13,12 @@ public Field create(String type, String value)
1313 if ((null == type ) || (null == value )) {
1414 throw new ConfigurationFieldException ();
1515 }
16- if (type .equals ("pubsub#owner" ) && (false == this .allowOwner )) {
16+ if (type .equals (Owner . FIELD_NAME ) && (false == this .allowOwner )) {
1717 throw new ConfigurationFieldException ();
18+ } else if (type .equals (Owner .FIELD_NAME )) {
19+ Owner field = new Owner ();
20+ field .setValue (value );
21+ return field ;
1822 } else if (type .equals (ChannelTitle .FIELD_NAME )) {
1923 ChannelTitle field = new ChannelTitle ();
2024 field .setValue (value );
Original file line number Diff line number Diff line change 11package org .buddycloud .channelserver .channel .node .configuration .field ;
22
3+ import org .xmpp .packet .JID ;
4+
35public class Owner extends Field
46{
57 public static final String FIELD_NAME = "pubsub#owner" ;
@@ -12,6 +14,12 @@ public Owner()
1214
1315 public boolean isValid ()
1416 {
15- return true ;
17+ try {
18+ JID owner = new JID (getValue ());
19+ owner .toBareJID ();
20+ return true ;
21+ } catch (IllegalArgumentException e ) {
22+ return false ;
23+ }
1624 }
1725}
You can’t perform that action at this time.
0 commit comments