Package nu.fw.jeti.jabber

Examples of nu.fw.jeti.jabber.JID


      {
        public void actionPerformed(ActionEvent e)
        {
          Map map = (Map)results.get(current);
          System.out.println("dfdf" + map.get("JID"));
          JID jid = JID.jidFromString((String)map.get("JID"));
          if(jid==null)return;
          new AddContact(jid,(String)map.get("nick"),null,backend).setVisible(true);     
        }
      });
      jPanel2.add(button);
      button = new JButton();
      I18N.setTextAndMnemonic("search.Chat",button);
      button.addActionListener(new ActionListener()
      {
        public void actionPerformed(ActionEvent e)
        {
          Map map = (Map)results.get(current);
          System.out.println("dfdf" + map.get("JID"));
          JID jid = JID.jidFromString((String)map.get("JID"));
          if(jid==null)return;
          backend.getMain().startChat(jid);
        }
      });
      jPanel2.add(button);
View Full Code Here


      {
        if(!txtServer.getText().equals(""))
        {
          //backend.browseNotCached(new JID(txtServer.getText()),bl);
          if(!txtRoom.getText().equals(""))
          backend.getItems(new JID(txtServer.getText()),txtRoom.getText(), PubSubBrowse.this);
          else backend.getItems(new JID(txtServer.getText()),PubSubBrowse.this);
         
         
          //backend.send(new InfoQuery(new JID(txtServer.getText()),"get",new IQDiscoItem()));
        }
         
View Full Code Here

            public void ownPresenceChanged(int show, String status) {
            }

            public void connectionChanged(boolean online) {
                if (!online) {
                    JID xmppAddress = connection.getMyJID();
                    JingleSession aux = null;
                    for (JingleSession jingleSession : jingleSessions) {
                        if (jingleSession.getInitiator().equals(xmppAddress) ||
                                jingleSession.getResponder().equals(xmppAddress)) {
                            aux = jingleSession;
View Full Code Here

          {
            room.setEditable(false);
            try
            {
              if(room.getText().equals(""))return;
              JID jid = JID.checkedJIDFromString(room.getText());
              Preferences.putString("groupchatalerter","room"+order
                  ,room.getText());
              try {
                Pattern.compile(rule.getText());
              }catch(PatternSyntaxException e2)
              {
                JOptionPane.showMessageDialog(PrefPanel.this, e2.getMessage());
                ruleEnabled.setSelected(false);
                return;
              }
              JID j2 = nu.fw.jeti.plugins.groupchat.Plugin.getGroupchatJID(jid);
              if(j2!=null)
              {//groupchat already loaded, init with that groupchat nickname
                jid =j2;
              }
              Plugin.addAlerter(new Alerter(backend,jid,rule.getText()),jid);
              Preferences.putBoolean("groupchatalerter","ruleEnabled"+order, ruleEnabled.isSelected());
            } catch (InstantiationException e2)
            {
              JOptionPane.showMessageDialog(PrefPanel.this, e2.getMessage());
              ruleEnabled.setSelected(false);
            }
          }
          else
          {
            Preferences.putBoolean("groupchatalerter","ruleEnabled"+order,ruleEnabled.isSelected());
            Plugin.removeAlerter(JID.jidFromString(room.getText()));
            room.setEditable(true);
          }
        }
      });
       room = new JTextField(Preferences.getString(
          "groupchatalerter","room"+ruleBlockNo,null));
       rule = new JTextField(Preferences.getString(
          "groupchatalerter","rule"+ruleBlockNo,null));
       rule.addFocusListener(new FocusListener()
      {
         private String ruleText;
        
        public void focusLost(FocusEvent e)
        {
          Preferences.putString("groupchatalerter","rule"+order
              ,rule.getText());
          Preferences.putString("groupchatalerter","room"+order
              ,room.getText());
          if(ruleEnabled.isSelected() && !rule.getText().equals(ruleText))
          {
            try {
              Pattern.compile(rule.getText());
            }catch(PatternSyntaxException e2)
            {
              JOptionPane.showMessageDialog(PrefPanel.this, e2.getDescription());
              return;
            }
          }
          JID jid = JID.jidFromString(room.getText());
          if(Plugin.isMonitoring(jid))
          {
            Plugin.updateRule(jid,rule.getText());
          }
        }
View Full Code Here

            I18N.gettext("main.popup.JID_of_user_to_add"),
            JOptionPane.QUESTION_MESSAGE);
        if (user == null || user.equals("")) {
            return;
        }
        JID jid = null;
        try {
            jid = JID.checkedJIDFromString(user);
        } catch (InstantiationException ex) {
            Popups.errorPopup(ex.getMessage(),
                              I18N.gettext("main.error.Wrong_Jabber_Identifier"));
            return;
        }
        if (jid == null || jid.getUser() == null) {
            JOptionPane.showMessageDialog(null,
                                          "There is no user named '"
                                          + user + "'", "Unknown user",
                                          JOptionPane.ERROR_MESSAGE);
            return;
View Full Code Here

    /*
     * IQMUCSetListListener interface
     */
    public void listSetOk(Vector jids, boolean aff, int value) {
        for (int i=0; i<jids.size(); i++) {
            JID jid = (JID)jids.get(i);
            XMUCUser oldUser = tableModel.getUser(jid);
            if (oldUser != null) {
                XMUCUser user;
                if (aff) {
                    user = new XMUCUser(jid, value, oldUser.getRole());
View Full Code Here

    else if(f.hasFeature(IQBind.class))doBind();
    else
    {
      if(state == State.COMPRESSION)
      {//server doesn't support bind so make own resource
        JID jid = new JID(loginInfo.getUsername().toLowerCase(),loginInfo.getServer() ,loginInfo.getResource());
        connect.authenticated(jid);
      }
      else connect.connected(connectionId, null);//no features so login with old
    }
  }
View Full Code Here

  {
    Thread worker = new Thread()
    {
      public void run()
      {
        JID jid = log.getFrom();
        String name = null;
        JIDStatus jidStatus = Backend.getJIDStatus(jid);
        if (jidStatus != null)
        {
          if(jidStatus.getType().equals("unknown") || jidStatus.getType().equals("jabber"))name = jid.toStringNoResource();
          else name = jid.getUser() + "." + jidStatus.getType();
        }
        else name = jid.toStringNoResource();

        BufferedWriter writer = null;
        String file = Start.path + "newlogs" + File.separator + name + ".txt";
        try
        {
View Full Code Here

        if (!xmppConnection.isLoggedIn()) {
            return null;
        }

        RTPBridge rtpPacket = new RTPBridge(sessionID);
        JID to = new JID(RTPBridge.NAME + "." + xmppConnection.getMyJID().getDomain());

//        PacketCollector collector = xmppConnection
//                .createPacketCollector(new PacketIDFilter(rtpPacket.getPacketID()));
//FIXME add to
        return new InfoQuery(to,"set", rtpPacket);
View Full Code Here

        System.out.println("Service listing");

//        ServiceDiscoveryManager disco = ServiceDiscoveryManager
//                .getInstanceFor(xmppConnection);
     
        xmppConnection.getItems(new JID(xmppConnection.getMyJID().getDomain()), new DiscoveryListener(){
      public void discoveryInfoResult(JID jid, DiscoveryInfo info){}
   
      public void discoveryItemResult(JID jid, DiscoveryItem item){
        boolean available = false;
        if (item.hasItems()){
View Full Code Here

TOP

Related Classes of nu.fw.jeti.jabber.JID

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.