MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / join

Method join

src/main/java/xmpp/extensions/muc/Conference.java:20–51  ·  view source on GitHub ↗
(String name, String jid, String pass, String nick, int maxStanzas)

Source from the content-addressed store, hash-verified

18 public final static String NS_MUC = "http://jabber.org/protocol/muc";
19
20 public static void join(String name, String jid, String pass, String nick, int maxStanzas) {
21 ConferenceGroup grp = StaticData.getInstance().roster.initMuc(jid, pass);
22 grp.name = name;
23
24 JabberDataBlock x = new JabberDataBlock("x");
25 x.setNameSpace(NS_MUC);
26 if (pass.length() != 0) {
27 x.addChild("password", pass); // adding password to presence
28 }
29
30 JabberDataBlock history = x.addChild("history", null);
31 history.setAttribute("maxstanzas", Integer.toString(maxStanzas));
32 history.setAttribute("maxchars", "32768");
33 try {
34 long last = grp.confContact.lastMessageTime;
35 long delay = (grp.conferenceJoinTime - last) / 1000;
36 if (last != 0) {
37 history.setAttribute("seconds", String.valueOf(delay)); // todo: change to since
38 }
39 } catch (Exception e) {
40 }
41
42 int status = StaticData.getInstance().roster.myStatus;
43 if (status == Presence.PRESENCE_INVISIBLE) {
44 status = Presence.PRESENCE_ONLINE;
45 }
46 StaticData.getInstance().roster.sendDirectPresence(status, jid, nick, x);
47
48 grp.inRoom = true;
49
50 //sd.roster.reEnumRoster();
51 }
52}

Callers 8

eventOkMethod · 0.95
menuActionMethod · 0.95
doActionMethod · 0.95
menuActionMethod · 0.95
blockArrivedMethod · 0.95
terminateThreadsMethod · 0.80
terminateThreadsMethod · 0.80

Calls 7

getInstanceMethod · 0.95
setNameSpaceMethod · 0.95
addChildMethod · 0.95
setAttributeMethod · 0.95
initMucMethod · 0.80
sendDirectPresenceMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected