Examples of toBareJID()


Examples of org.xmpp.packet.JID.toBareJID()

            String username = decoded.substring(0,i);
            if (!username.contains("@")) {
                throw new Exception("Not a valid JID.");
            }
            jid = new JID(username);
            XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(service).getChatRoom(room).getOccupantsByBareJID(jid.toBareJID());
            return true;
        }
        catch (Exception e) {
            /**
             * This covers all possible authorization issues.  Eg:
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

            }
        }
        // Check if sender and subscriber JIDs match or if a valid "trusted proxy" is being used
        JID from = iq.getFrom();
        JID subscriberJID = new JID(subscribeElement.attributeValue("jid"));
        if (!from.toBareJID().equals(subscriberJID.toBareJID()) && !service.isServiceAdmin(from)) {
            // JIDs do not match and requestor is not a service admin so return an error
            Element pubsubError = DocumentHelper.createElement(
                    QName.get("invalid-jid", "http://jabber.org/protocol/pubsub#errors"));
            sendErrorPacket(iq, PacketError.Condition.bad_request, pubsubError);
            return;
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

                        case outcast:
                            room.addOutcast(jid, null, room.getRole());
                            break;
                        default:
                            Log.error("Unkown affiliation value " + affiliation + " for user "
                                    + jid.toBareJID() + " in persistent room " + room.getID());
                    }
                }
                catch (Exception e) {
                    Log.error(e.getMessage(), e);
                }
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

            return true;
        }
        // Get the only owner of the node
        JID nodeOwner = node.getOwners().iterator().next();
        // Give access to the owner of the roster :)
        if (nodeOwner.toBareJID().equals(owner.toBareJID())) {
            return true;
        }
        // Get the roster of the node owner
        XMPPServer server = XMPPServer.getInstance();
        // Check that the node owner is a local user
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

            return true;
        }
        // Get the only owner of the node
        JID nodeOwner = node.getOwners().iterator().next();
        // Give access to the owner of the roster :)
        if (nodeOwner.toBareJID().equals(owner.toBareJID())) {
            return true;
        }
        // Get the roster of the node owner
        XMPPServer server = XMPPServer.getInstance();
        // Check that the node owner is a local user
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

                    } else if ("visitor".equals(target)) {
                        // Add the user as a visitor of the room based on the full JID
                        presences.add(room.addVisitor(jid, senderRole));
                    } else if ("member".equals(target)) {
                        // Add the user as a member of the room based on the bare JID
                        boolean hadAffiliation = room.getAffiliation(jid.toBareJID()) != MUCRole.Affiliation.none;
                        presences.addAll(room.addMember(jid, nick, senderRole));
                        // If the user had an affiliation don't send an invitation. Otherwise
                        // send an invitation if the room is members-only and skipping invites
                       // are not disabled system-wide xmpp.muc.skipInvite
                        if (!skipInvite && !hadAffiliation && room.isMembersOnly()) {
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

                String name;
                try {
                    name = UserNameManager.getUserName(user);
                }
                catch (UserNotFoundException e) {
                    name = user.toBareJID();
                    anonymous = true;
                }
                for (ConversationParticipation participation : entry.getValue().getParticipations()) {
                    if (participation.getJoined() == null) {
                        Log.warn("Found muc participant with no join date in conversation: " + conversationID);
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

            for (Map.Entry<String, UserParticipations> entry : participants.entrySet()) {
                JID user = new JID(entry.getKey());
                for (ConversationParticipation participation : entry.getValue().getParticipations()) {
                    pstmt.setLong(1, conversationID);
                    pstmt.setLong(2, participation.getJoined().getTime());
                    pstmt.setString(3, user.toBareJID());
                    pstmt.setString(4, user.getResource() == null ? " " : user.getResource());
                    pstmt.setString(5, participation.getNickname());
                    pstmt.executeUpdate();
                }
            }
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

        if (!read || processed) {
            // Ignore packets that are being sent or have been processed
            return;
        }
        JID jid = packet.getFrom();
        if (jidBanMap.containsKey(jid.toBareJID()) || domainBanMap.containsKey(jid.getDomain())) {
            sendNotifications(packet, jid.toString());
            PacketRejectedException exception = new PacketRejectedException("User '" +
                    packet.getFrom().toBareJID() +
                    "' not allowed to join queue.");
            if (rejectionMessage != null) {
View Full Code Here

Examples of org.xmpp.packet.JID.toBareJID()

                        } else if ("admin".equals(targetAffiliation)) {
                            // Add the new user as an admin of the room
                            presences.addAll(room.addAdmin(jid, senderRole));
                        } else if ("member".equals(targetAffiliation)) {
                            // Add the new user as a member of the room
                            boolean hadAffiliation = room.getAffiliation(jid.toBareJID()) != MUCRole.Affiliation.none;
                            presences.addAll(room.addMember(jid, null, senderRole));
                            // If the user had an affiliation don't send an invitation. Otherwise
                            // send an invitation if the room is members-only and skipping invites
                            // are not disabled system-wide xmpp.muc.skipInvite
                            if (!skipInvite && !hadAffiliation && room.isMembersOnly()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.