Package net.solosky.maplefetion.client.dialog

Examples of net.solosky.maplefetion.client.dialog.MutipartyDialog


     * 用户进入了会话
     */
    private void userEntered(Element event)
    {
      if(this.dialog instanceof MutipartyDialog) {
        MutipartyDialog cd = (MutipartyDialog) this.dialog;
        List list = event.getChildren("member");
        if(list!=null){
          Iterator it = list.iterator();
          while(it.hasNext()){
            Element member = (Element) it.next();
            String uri = member.getAttributeValue("uri");
            Buddy buddy = this.context.getFetionStore().getBuddyByUri(uri);
            //可能用户删除了好友,这里就查不到了
            if(buddy==null){
              buddy = UriHelper.createBuddy(uri);
              BeanHelper.setValue(buddy, "relation", Relation.STRANGER);
            }
            cd.buddyEntered(buddy);
           
            logger.debug("Buddy entered this dialog:"+uri);
          }
        }
      }
View Full Code Here


     * @throws Exception
     */
    private void userLeft(Element event)
    {
      if(this.dialog instanceof MutipartyDialog) {
        MutipartyDialog cd = (MutipartyDialog) this.dialog;
       
        List list = event.getChildren("member");
        if(list!=null){
          Iterator it = list.iterator();
          while(it.hasNext()){
            Element member = (Element) it.next();
            String uri = member.getAttributeValue("uri");
            Buddy buddy = this.context.getFetionStore().getBuddyByUri(uri);
            //如果好友不存在,可能用户已经删除了该好友,这里新建一个临时好友对象
            //仅是为了作为参数传递个对话来判断那个好友离开了对话,因为对话保留了一个好友的引用
            if(buddy==null){
              buddy = UriHelper.createBuddy(uri);
            }
            cd.buddyLeft(buddy);
           
            logger.debug("Buddy left this dialog:"+uri);
          }
        }
      }
View Full Code Here

     * @param event
     */
    private void userFailed(Element event)
    {
      if(this.dialog instanceof MutipartyDialog) {
        MutipartyDialog cd = (MutipartyDialog) this.dialog;
       
        List list = event.getChildren("member");
        if(list!=null){
          Iterator it = list.iterator();
          while(it.hasNext()){
            Element member = (Element) it.next();
            String uri = member.getAttributeValue("uri");
            Buddy buddy = this.context.getFetionStore().getBuddyByUri(uri);
            //如果好友不存在,可能用户已经删除了该好友,这里新建一个临时好友对象
            //仅是为了作为参数传递个对话来判断那个好友离开了对话,因为对话保留了一个好友的引用
            if(buddy==null){
              buddy = UriHelper.createBuddy(uri);
            }
            cd.buddyFailed(buddy);
           
            logger.debug("Buddy failed to enter this dialog:"+uri);
          }
        }
      }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.client.dialog.MutipartyDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.