Package hamsam.api

Examples of hamsam.api.Buddy


    }

    if(who == null)
      return;

    Buddy buddy = new Buddy(this, who, where);

    if(status == 0)
      listener.buddyAdded(buddy);
    else if(status == 2)
      listener.buddyAddFailed(buddy, "This user is already present in your buddy list");
View Full Code Here


    }

    if(who == null)
      return;

    Buddy buddy = new Buddy(this, who, where);

    if(success)
      listener.buddyDeleted(buddy);
    else
      listener.buddyDeleteFailed(buddy, "This user is not in your buddy list");
View Full Code Here

    }

    if(who == null)
      return;

    Buddy buddy = new Buddy(this, who);

    /*
     * status
     *   0  - ok
     *   2  - already in ignore list, could not add
View Full Code Here

  private SwitchboardServer startSBSession(Buddy buddy) throws IllegalStateException
  {
    try
    {
      NotificationServer ns = checkValidNotificationServer();
      Buddy host = new Buddy(this, username);
      Buddy[] participants = new Buddy[2];
      participants[0] = host;
      participants[1] = buddy;
      Conference conf = new Conference(this, host, participants);
      ns.startSBSession(conf);
View Full Code Here

    if (source == ok) {
      //if buddy name is given
      if (checkValues()) {
        //if no group is defined
        if (groupField.equals("")) {
          newBuddy = new Buddy(ConnectionInfos.currentProtocol,
                               nameField.getText());
        }
        else {
          newBuddy = new Buddy(ConnectionInfos.currentProtocol,
                     nameField.getText(),
                     groupField.getText());
        }
        Traces.printTraces("New buddy created");
        Traces.printTraces("name     : " + newBuddy.getUsername());
View Full Code Here

        Traces.printErrorMessage(e, MainFrame.myRef);
     
    }
   
    //Buddy left
    Buddy b = null;     
    Traces.printTraces("Buddy left :");
    for (int i=0; i<myBuddies.size(); i++) {
      b = (Buddy)myBuddies.elementAt(i);
      Traces.printTraces("buddy " + i + " : " + b.getUsername());
    }     
  }
View Full Code Here

  }
  }

  public Buddy[] getSelectedBuddies() {   
    int index[] = buddyList.getSelectedIndices();
  Buddy ret[] = new Buddy[index.length];
    for (int i=0; i<index.length; i++) {
      ret[i] = (Buddy)myBuddies.elementAt(index[i]);
    }
    return ret;
  }
View Full Code Here

  {
    sendButton = new JButton(this.propertiesMgr.getValue("sendButton"));
    ignore = new JButton(this.propertiesMgr.getValue("ignoreButton"));
    unIgnore = new JButton(this.propertiesMgr.getValue("unIgnoreButton"));
    close = new JButton(this.propertiesMgr.getValue("closeButton"));
    Buddy b = null;
    for (int i = 0; i < buddyVector.size(); i++)
    {
      b = (Buddy) buddyVector.elementAt(i);
      model.addElement(b.getUsername());
    }
    this.buddyList.setSelectionMode(
      ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    buddyPane = new JScrollPane(buddyList);
View Full Code Here

    if(cmd instanceof Command)
    {
      String type = cmd.getType();
      if("IRO".equals(type))
      {
        Buddy buddy = new Buddy(conf.getProtocol(), cmd.getParam(2));
        buddy.setAlias(Util.urlDecode(cmd.getParam(3)));
        conf.addParticipant(buddy);
      }
      else if("ANS".equals(type) && "OK".equals(cmd.getParam(0)))
      {
        Buddy[] buddies = conf.getParticipants();
        for(int i = 0; i < buddies.length; i++)
          processor.conferenceParticipantJoined(conf, buddies[i]);
         
        // Add yourself to the conference
        Buddy myself = new Buddy(protocol, protocol.getUsername());
        conf.addParticipant(myself);
      }
    }
  }
View Full Code Here

      if(body != null)
      {
        Message apiMessage = Util.parseMSNMessage(body, font, color);
        String passport = msg.getParam(0);
        String alias = msg.getParam(1);
        Buddy buddy = new Buddy(protocol, passport);
        buddy.setAlias(alias);
        processor.conferenceMessageReceived(this.conf, buddy, apiMessage);
      }
    }
  }
View Full Code Here

TOP

Related Classes of hamsam.api.Buddy

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.