+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13

Thread: Using filters

  1. #11
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,214
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    But you just said that the room was being created by the client, not by a plugin. I'm confused. Whichever one creates the room has to add the language filter and enable it. What I gave above is for when the client creates the room using CreateRoomRequest.

    When a plugin creates a room, you can use getApi().createRoom(int zoneId,
    RoomConfiguration roomConfig,
    UserConfig[] userConfigs)

    where the roomConfig has already had isUsingLanguageFilter() and setLanguageFilterName etc. done to it.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  2. #12
    Member
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i see....

    well...this is how we did it...all room creation are done by the client...the client will use a plugin called ChatPlugin which deals with all the chat services done in the request().

    So in the client code,
    1) Create the room
    2) Set language filter (need to be added)
    3) Encapsulate the message into an EsObject (eg. esObject.setString("message", "what f-up");
    4) calls one of the ChatPlugin

    On the server side
    1) request() will determine what action it is (we usually put some code into the EsObject to determine what service needs to be handled eg. esObject.setInteger("Action", "sendingChatMessage");
    2) the server then needs to apply filter language

    Can I do this. Even though the rooms are created on the client side. My chat plugin is not related to any rooms, but can I set the language filter to this chat plugin, then make a call to getApi().applyLanguageFilter()?? I dont think BasePlugin Api support such method and it looks like we are restricted to whoever creates the room will be able to set the lang filter, right?

  3. #13
    Member
    Join Date
    Feb 2008
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Teresa,

    Long time, no see.. Well. I am also stuck in the same problem.. Following is the code i am using for creating rooms from plugins. And you can see i am adding them to use their default language and flooding filters.. But its not working.. Users are freely using the foul languages

    Code:
    	private void createRoomInZone(String zoneName, String roomName, int capacity, ExtensionComponentConfiguration roomPlugin, RoomVariable roomVar) 
    	{
    
    	   try
    	   {
    	       RoomConfiguration roomConfig = new RoomConfiguration();
    	       roomConfig.setName(roomName);
    	       roomConfig.setCapacity(capacity);
    	       roomConfig.setPersistent(true);
    	       roomConfig.addPlugin(roomPlugin);
    	       roomConfig.setUsingFloodingFilter(true);
    	       roomConfig.setUsingLanguageFilter(true);
    	       roomConfig.setNonOperatorUpdateAllowed(true);
    	       roomConfig.setNonOperatorVariableUpdateAllowed(true);
    	       if ( roomVar != null )
    	    	   roomConfig.addVariable(roomVar);
    	       
    	       UserConfig[] userConfigs = new UserConfig[0];
    
    		   RoomResponse response = getApi().createRoomInNamedZone(zoneName, false, roomConfig, userConfigs);
    		   if (response.getStatus() == Status.Success)
    		   {
    	           //System.out.println("  Room Successfully created. --> "+response.getZoneId()+" : "+response.getRoomId());
    		   }
    		   else 
    	       {
    	           for (ErrorType error : response.getErrors()) 
    	           {
    	           		System.out.println("Error while creating room "+response.getRoomId()+" Error: "+error.toString());
    	           }
    	       }		   
    	   }
    	   catch(Exception e)
    	   {
    		   logger.error("AdminPlugin: createRoomInZone: Caught exception while creating room "+roomName+"in zone "+zoneName+" error "+printException(e));
    	   }
    	}
    Point to be noted here is, any room created from the client and the filters attached from the client works fine.. Only the server created rooms are having this problem.. But I have a requirement to create certain rooms from the server. Please help.

    Thanks
    Sankar

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts