如何从开放式壁炉的Android找回聊天记录 [英] How to retrieve chat history from open fire in android
本文介绍了如何从开放式壁炉的Android找回聊天记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有,我要找回两个用户之间的聊天记录聊天应用程序,我有一个节检索聊天消息,那就是...
< IQ系列='得到'ID ='PK1'>
<列表的xmlns =瓮:XMPP:档案
与='shrey27 @系统1-PC'>
<设置的xmlns =HTTP://jabber.org/protocol/rsm'>
&其中;最大→30&所述; /最大>
< /集>
< /列表>
< / IQ>
现在,我的问题是我怎么能触发此节到服务器,这样我可以得到response.I已经安装了邮件存档插件和消息也越来越存储perfectly.any建议将是有益的... 提前致谢!!!
解决方案
NSXMLElement *智商= [NSXMLElement elementWithName:@智商];
[智商addAttributeWithName:@型stringValue的:@搞定];
[智商addAttributeWithName:@标识stringValue的:@987654321];
NSXMLElement *列表= [NSXMLElement elementWithName:@清单];
[列表addAttributeWithName:@的xmlnsstringValue的:@金塔:XMPP:档案];
[列表addAttributeWithName:@与stringValue的:@bhushan@development.sapplica.com];
NSXMLElement *设置= [NSXMLElement elementWithName:@设置];
[集addAttributeWithName:@的xmlnsstringValue的:@http://jabber.org/protocol/rsm];
NSXMLElement *最大= [NSXMLElement elementWithName:@最大];
[最大addAttributeWithName:@的xmlnsstringValue的:@http://jabber.org/protocol/rsm];
max.stringValue = @30;
[设置的addChild:MAX];
[列表的addChild:设置]
[智商的addChild:列表]
[[[自我的appDelegate] xmppStream] sendElement:智商];
您可以这样调用。希望这有助于:)
I have a chat app in which I want to retrieve chat history between two users, I have a stanza for retrieving chat messages and that is...
<iq type='get' id='pk1'>
<list xmlns='urn:xmpp:archive'
with='shrey27@sys1-pc'>
<set xmlns='http://jabber.org/protocol/rsm'>
<max>30</max>
</set>
</list>
</iq>
now, my problem is how can I fire this stanza to the server so that I can get the response.I have installed the message archiving plugin and messages are getting stored perfectly.any suggestions would be beneficial... thanks in advance!!!
解决方案
NSXMLElement *iQ = [NSXMLElement elementWithName:@"iq"];
[iQ addAttributeWithName:@"type" stringValue:@"get"];
[iQ addAttributeWithName:@"id" stringValue:@"987654321"];
NSXMLElement *list = [NSXMLElement elementWithName:@"list"];
[list addAttributeWithName:@"xmlns" stringValue:@"urn:xmpp:archive"];
[list addAttributeWithName:@"with" stringValue:@"bhushan@development.sapplica.com"];
NSXMLElement *set = [NSXMLElement elementWithName:@"set"];
[set addAttributeWithName:@"xmlns" stringValue:@"http://jabber.org/protocol/rsm"];
NSXMLElement *max = [NSXMLElement elementWithName:@"max"];
[max addAttributeWithName:@"xmlns" stringValue:@"http://jabber.org/protocol/rsm"];
max.stringValue = @"30";
[set addChild:max];
[list addChild:set];
[iQ addChild:list];
[[[self appDelegate] xmppStream] sendElement:iQ];
You can call like this. Hope this helps :)
这篇关于如何从开放式壁炉的Android找回聊天记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文