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

Method publish

src/main/java/PEP/ActivityList.java:64–88  ·  view source on GitHub ↗
(int activity, String text)

Source from the content-addressed store, hash-verified

62 }
63
64 public void publish(int activity, String text) {
65 String sid="publish-activity";
66 JabberDataBlock setActivity=new Iq(null, Iq.TYPE_SET, sid);
67 JabberDataBlock action=setActivity.addChildNs("pubsub", "http://jabber.org/protocol/pubsub") .addChild("publish", null);
68 action.setAttribute("node", "http://jabber.org/protocol/activity");
69 JabberDataBlock item=action.addChild("item", null);
70 //item.setAttribute("id", Activities.getInstance().myActId);
71 JabberDataBlock act=item.addChildNs("activity", "http://jabber.org/protocol/activity");
72 if (activity > 0) {
73 String[] actName = Activities.getInstance().getActName(activity);
74 JabberDataBlock gen = act.addChild(actName[0], null);
75 gen.addChild(actName[1], null);
76 act.addChild("text", text);
77 }
78
79 try {
80 //todo: refactor theStream call; send notification to JabberBlockListener if stream was terminated
81 sd.getTheStream().addBlockListener(new PepPublishResult(sid));
82 sd.getTheStream().send(setActivity);
83 } catch (Exception e) {
84 if (StaticData.Debug) {
85 e.printStackTrace();
86 }
87 }
88 }
89}
90
91//#endif

Callers 1

OkNotifyMethod · 0.95

Calls 8

addChildMethod · 0.95
addChildNsMethod · 0.95
setAttributeMethod · 0.95
getInstanceMethod · 0.95
getActNameMethod · 0.80
getTheStreamMethod · 0.80
addBlockListenerMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected