smack

How do I get the message from the message id in smack.

丶灬走出姿态 提交于 2019-12-04 05:01:41
问题 I am trying to fetch the chat history using below function: var mamManager:MamManager= MamManager.getInstanceFor(connection) var prevMsg=mamManager.queryArchive(JidCreate.entityBareFrom(jid)).forwardedMessages println(msg.forwardedStanza) But I am getting the output as 04-19 14:17:58.414 7964-7964/com.example.itstym.smackchat I/System.out: Message Stanza [to=user2@replica3377.cloudapp.net,from=user1@replica3377.cloudapp.net/307135084148417199024926,id=qQ73x-27,] I can also get stanza id using

How to read custom attributes of xmpp message tag in android?

99封情书 提交于 2019-12-04 05:01:13
问题 The xml that i need to receive is : <message id="qm5Dx8" to="adsfxcv" type="chat"from="adsf" msgType="2" thumbnail="randomThumbnail" serverMediaURL="random" isFromMe="1" status="1"><body>Image</body><request xmlns='urn:xmpp:receipts'/></message> Message is being sent by MyCustomMessage extends Message class. In my message listener, Where i need to get the packet is : public void processPacket(Packet packet) { String recivedPacket = packet.toXML(); try { if (packet instanceof MyCustomMessage)

Smack on Android, getting error code=“404” remote-server-not-found while sending packets/message between two users via local Openfire server

[亡魂溺海] 提交于 2019-12-04 04:10:15
问题 I was glad to implement smack on android via local Openfire server where it connects to Gmail server-host and it worked like charm. The tutorial found here But I'm getting an error (pasted below) when I'm trying to connect two users via android emulators with a local Openfire server installed. 03-23 16:24:01.392: DEBUG/SMACK(233): 04:24:01 PM SENT (1155246128): <message id="t0tgA-5" to="justestingchat2" type="chat"><body>hi</body></message> 03-23 16:24:07.032: DEBUG/SMACK(233): 04:24:07 PM

how to get user online or offline in asmack, android [duplicate]

筅森魡賤 提交于 2019-12-04 02:48:50
Possible Duplicate: XMPP aSmack - How can I get the current user state (offline/online/away/etc.)? I am developing chat app on Android base on asmack lib. I display all the user on the ListView but I use an image to show online/offline user. But It return offline image only, even the user is online, here is my code @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.buddies); Controller.getInstance().roster = Controller.getInstance().connection.getRoster(); // ArrayList<Buddy> buddies = new ArrayList<Buddy>(); Collection

send and receiving message using smack API

為{幸葍}努か 提交于 2019-12-04 00:36:10
问题 I have setup my open fire(jabber server) on local machine with two user testuser1 and testuser2 .using Spark client both users perform chat without any issue,it's nice. openfire IP -192.168.1.65 I want to use smack API(3.3.0) for send and receiving message. i have write sender side code to send message(with testuser1) and tested with Spark client(with testuser2) message received on testuser2 side,but when i try with java code to receive sender message ,i am not able to receive those publish

item-not-found(404) when trying to get a node using Smackx pubsub

删除回忆录丶 提交于 2019-12-03 20:45:26
I'm trying to use the latest Smackx trunk to get and then subscribe to a pubsub node. However, openfire just sends me a back an error: item not found (404). I am instantiating the java objects from ColdFusion, so my code snippets might look funny but maybe someone will be able to tell me what I've forgotten. Here's how I create the node: ftype = createObject("java", "org.jivesoftware.smackx.pubsub.FormType"); cform = createObject("java", "org.jivesoftware.smackx.pubsub.ConfigureForm").init(ftype.submit); cform.setPersistentItems(true); cform.setDeliverPayloads(true); caccess = createObject(

how to create persistent muc room in smack 4.1 beta2

痞子三分冷 提交于 2019-12-03 18:22:06
migrated from asmack to smack 4.1 beta2. The muc rooms created are no longer persistent. MultiUserChatManager mucm=MultiUserChatManager.getInstanceFor(connection); muc=mucm.getMultiUserChat(groupid+"@conference.localhost"); DiscussionHistory histroy=new DiscussionHistory(); histroy.setMaxStanzas(10); muc.createOrJoin(username,null,histroy,SmackConfiguration.getDefaultPacketReplyTimeout()); muc.nextMessage(); when created with gajim, the rooms are persistent. EDIT : Here is code we used earlier. By default the chat rooms were persistent, muc = new MultiUserChat(connection, groupid+"@conference

Not able to receive group message using smack

天涯浪子 提交于 2019-12-03 18:10:45
问题 var multiUserManager: MultiUserChatManager = MultiUserChatManager.getInstanceFor(constants.obj.connection) var multiUserChat: MultiUserChat =multiUserManager.getMultiUserChat(JidCreate.entityBareFrom(roomName)) var a: Resourcepart = Resourcepart.from(PreferenceManager.getDefaultSharedPreferences(applicationContext).getString("j_id", null)) multiUserChat.join(a) multiUserChat.addMessageListener { object: MessageListener { override fun processMessage(message: Message?) { Log.v("Message is "

android file transfer using smack

我怕爱的太早我们不能终老 提交于 2019-12-03 16:50:01
I am working on chatting application and i have to implement file transfer using smack api. I am able to Connect to the open fire server and can also chat with another client.But i dont know how to implement file transfer..I have found a code snippet but i am not ableto send it using that also.Following is the code snippet i am using: public void SendFile(final String Receiver, final String Directory) { Thread thread = new Thread() { public void run() { ServiceDiscoveryManager sdm = ServiceDiscoveryManager .getInstanceFor(connection); if (sdm == null) sdm = new ServiceDiscoveryManager

aSmack error: XMPPConnection is abstract; cannot be instantiated

馋奶兔 提交于 2019-12-03 16:25:32
I'm following a tutorial to make a very basic chat app with Android Studio, but I'm getting the error: Error:(131, 45) error: XMPPConnection is abstract; cannot be instantiated at the following line: ConnectionConfiguration connConfig = new ConnectionConfiguration(HOST, PORT, SERVICE); XMPPConnection connection = new XMPPConnection(connConfig); And I'm also getting some "Unhandled exception" when trying to use XMPPConnection elements. Also link to the tutorial: LINK Looks like this changed in Smack 4.0.0. The documentation still has not been updated. And it looks like they will change it again