Package hamsam.api

Examples of hamsam.api.Response


      // send the invitation
      Buddy host = new Buddy(protocol, passport);
      host.setAlias(alias);
      Buddy[] buddies = new Buddy[] {host};
      Conference conf = new Conference(protocol, host, buddies);
      Response res = processor.conferenceInvitationReceived(conf, "");

      if(res.isAccepted())
        joinSBSession(sessionID, server, authString, conf);
    }
    catch(HamsamException e)
    {
      // this won't be thrown, ever
View Full Code Here


        away = Integer.parseInt(value);
    }

    if(myid != null)
    {
      Response resp = listener.buddyAddRequest(new Buddy(this, who), new Buddy(this, myid), msg);
      if(!resp.isAccepted())
      {
        Packet retPack = new Packet(SERVICE_REJECTCONTACT, STATUS_AVAILABLE, sessionID);
        retPack.putData(1, yahooID);
        retPack.putData(7, who);
        retPack.putData(14, resp.getMessage());

        sendToWriterThread(retPack);
      }
    }
    else if(name != null)
View Full Code Here

        {
          try
          {
            Buddy[] buddies = (Buddy[]) members.toArray(new Buddy[0]);
            Conference conf = new Conference(this, host, buddies);
            Response resp = listener.conferenceInvitationReceived(conf, msg);
            processConferenceResponse(resp, buddies, room);
          }
          catch(UnsupportedOperationException e)
          {
            // this exception will never be thrown
          }
          catch(IllegalArgumentException e)
          {
            // this exception will never be thrown
          }
        }
        else if(msg != null)
        {
          listener.protocolMessageReceived(this, Util.parseYahooMessage(msg));
        }
        break;

      case SERVICE_CONFADDINVITE:
        if(pack.getStatus() == 2)
          ;
        else
        {
          try
          {
            Buddy[] buddies = (Buddy[]) members.toArray(new Buddy[0]);
            Conference conf = new Conference(this, host, buddies);
            Response resp = listener.conferenceInvitationReceived(conf, msg);
            processConferenceResponse(resp, buddies, room);
          }
          catch(UnsupportedOperationException e)
          {
            // this exception will never be thrown
View Full Code Here

  }

  public Response buddyAddRequest(Buddy buddy, Buddy myself, String message) {
    System.out.println(buddy.getUsername() + " is trying to add " +
                       myself.getUsername() + " to his buddy list: " + message);
    return new Response();
  }
View Full Code Here

    for (int i = 0; i < parts.length; i++)
      System.out.print(parts[i].getUsername() + " ");

    System.out.println();

    return new Response();
  }
View Full Code Here

TOP

Related Classes of hamsam.api.Response

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.