Package net.solosky.maplefetion.bean

Examples of net.solosky.maplefetion.bean.Relation


   * @return
   */
  public synchronized ChatDialog createChatDialog(Buddy buddy)
          throws DialogException
  {
    Relation relation = buddy.getRelation();
    if( relation==Relation.BANNED ||
      relation==Relation.DECLINED ||
      relation==Relation.UNCONFIRMED) {
      throw new DialogException("Buddy relation is +"+buddy.getRelation()+", you couldn't send chat message to this buddy.");
    }
View Full Code Here


        Element e = (Element) it.next();
        String uri = e.getAttributeValue("uri");
        Buddy buddy = context.getFetionStore().getBuddyByUri(uri);
        if(buddy!=null) {
          //检查用户关系的变化
          Relation relation = ParseHelper.parseRelation(e.getAttributeValue("relation-status"));
          //如果当前好友关系是没有确认,而返回的好友是确认了,表明好友同意了你添加好友的请求
          if(relation==Relation.BUDDY && buddy.getRelation()!=Relation.BUDDY) {
           
            //因为这里是手机好友,没有详细信息,故不再获取详细信息
            logger.debug("Mobile buddy agreed your buddy request:"+buddy.getFetionId());
View Full Code Here

        Element e =  (Element) it.next();
        String uri = e.getAttributeValue("uri");
        final Buddy buddy = context.getFetionStore().getBuddyByUri(uri);
        if(buddy!=null) {
          //检查用户关系的变化
          Relation relation = ParseHelper.parseRelation(e.getAttributeValue("relation-status"));
          //如果当前好友关系是没有确认,而返回的好友是确认了,表明好友同意了你添加好友的请求
          if(relation==Relation.BUDDY && buddy.getRelation()!=Relation.BUDDY) {
           
            //这里还需要获取好友的详细信息
            SipcRequest request = dialog.getMessageFactory().createGetContactInfoRequest(buddy.getUri());
View Full Code Here

   * @param listener 操作结果监听器
   */
  public void sendChatMessage(final Buddy toBuddy, final Message message, ActionEventListener listener)
  {
    this.ensureOnline();
    Relation relation = toBuddy.getRelation();
    if( relation==Relation.BANNED||
      relation==Relation.DECLINED||
      relation==Relation.UNCONFIRMED) {
      if(listener!=null) listener.fireEevent(new FailureEvent(FailureType.BUDDY_RELATION_FORBIDDEN));
    }else {
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.bean.Relation

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.