From 8cb9bc12a6befaf8211a26abf37cd26597c00d0d Mon Sep 17 00:00:00 2001 From: lujiangbin Date: Fri, 4 Dec 2015 11:14:53 +0800 Subject: [PATCH 1/3] resend the unacked stanzaIds by the server --- Extensions/XEP-0198/XMPPStreamManagement.h | 9 +++++++++ Extensions/XEP-0198/XMPPStreamManagement.m | 22 +++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Extensions/XEP-0198/XMPPStreamManagement.h b/Extensions/XEP-0198/XMPPStreamManagement.h index f49fec4507..65f46490c3 100644 --- a/Extensions/XEP-0198/XMPPStreamManagement.h +++ b/Extensions/XEP-0198/XMPPStreamManagement.h @@ -299,6 +299,15 @@ - (void)xmppStreamManagement:(XMPPStreamManagement *)sender wasEnabled:(NSXMLElement *)enabled; - (void)xmppStreamManagement:(XMPPStreamManagement *)sender wasNotEnabled:(NSXMLElement *)failed; + +/** + * Resend the stanzaIds not acked by the server + * + * @param stanzaIds Includes all "stanzaIds" of sent elements that were not acked by the server. + */ +- (void)xmppStreamManagement:(XMPPStreamManagement *)sender shouldResendStanzaIds:(NSArray *)stanzaIds; + + /** * Notifies delegates that a request for an ack from the server was sent. **/ diff --git a/Extensions/XEP-0198/XMPPStreamManagement.m b/Extensions/XEP-0198/XMPPStreamManagement.m index 8e49094350..622af432cc 100644 --- a/Extensions/XEP-0198/XMPPStreamManagement.m +++ b/Extensions/XEP-0198/XMPPStreamManagement.m @@ -557,7 +557,27 @@ - (void)processResumed:(NSXMLElement *)resumed (unsigned long)[prev_unackedByServer count]); diff = (uint32_t)[prev_unackedByServer count]; - } + } + else if (diff < [prev_unackedByServer count]) + { + //Resend All unacked stanzaIds by Server + NSUInteger offset = [prev_unackedByServer count] - diff; + + NSMutableArray *resendIds = [NSMutableArray array]; + + for (NSUInteger i = offset; i > 0; i--) + { + NSUInteger index = [prev_unackedByServer count] - i; + XMPPStreamManagementOutgoingStanza *outgoingStanza = prev_unackedByServer[index]; + + if (outgoingStanza.stanzaId) { + [resendIds addObject:outgoingStanza.stanzaId]; + } + } + [multicastDelegate xmppStreamManagement:self shouldResendStanzaIds:resendIds]; + + } + NSMutableArray *stanzaIds = [NSMutableArray arrayWithCapacity:(NSUInteger)diff]; From 3302c885ea5d28fb520186b0db70856811ab9fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=91=E4=B8=8B=E7=9A=84=E8=80=81=E7=94=B7=E5=AD=A9?= <779242220@qq.com> Date: Tue, 1 Mar 2022 21:49:31 +0800 Subject: [PATCH 2/3] Added emocache --- emocache | 1 + 1 file changed, 1 insertion(+) create mode 100644 emocache diff --git a/emocache b/emocache new file mode 100644 index 0000000000..b8e8322980 --- /dev/null +++ b/emocache @@ -0,0 +1 @@ +UzV2zq1wL0osyPDNT0nNUTV2VTV2LsrPL4GwciucU3NyVI0MMlNUjV1UjYwMgFjVyA2HrCFY1qAgsSg1rwSLBiADYTaQg2Y1AA== \ No newline at end of file From 5b4fdab65487d4ea8d13c57e7526568d4f3d6ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A0=91=E4=B8=8B=E7=9A=84=E8=80=81=E7=94=B7=E5=AD=A9?= <779242220@qq.com> Date: Wed, 2 Mar 2022 09:49:48 +0800 Subject: [PATCH 3/3] Update emocache --- emocache | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/emocache b/emocache index b8e8322980..c591771f44 100644 --- a/emocache +++ b/emocache @@ -1 +1,25 @@ -UzV2zq1wL0osyPDNT0nNUTV2VTV2LsrPL4GwciucU3NyVI0MMlNUjV1UjYwMgFjVyA2HrCFY1qAgsSg1rwSLBiADYTaQg2Y1AA== \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + +