From 477a2b114c513f9d1edff32ee9ae5e3f6760ff58 Mon Sep 17 00:00:00 2001 From: rcorniere Date: Mon, 9 Mar 2020 17:19:29 +0100 Subject: [PATCH] Changelog and doc --- CHANGELOG.md | 2 ++ router.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83dd323..41f58ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ - Added message queue : when using "SendX" methods on a client, messages are also stored in a queue. When requesting acks from the server, sent messages will be discarded, and unsent ones will be sent again. (see https://xmpp.org/extensions/xep-0198.html#acking) - Added support for stanza_errors (see https://xmpp.org/rfcs/rfc3920.html#def C.2. Stream error namespace and https://xmpp.org/rfcs/rfc6120.html#schemas-streamerror) +- Added separate hooks for connection and reconnection on the client. One can now specify different actions to get triggered on client connect +and reconnect, at client init time. - Client state update is now thread safe - Changed the Config struct to use pointer semantics - Tests diff --git a/router.go b/router.go index d334d36..7bba8b9 100644 --- a/router.go +++ b/router.go @@ -81,6 +81,7 @@ func (r *Router) route(s Sender, p stanza.Packet) { } } +// SendMissingStz sends all stanzas that did not reach the server, according to the response to an ack request (see XEP-0198, acks) func SendMissingStz(lastSent int, s Sender, uaq *stanza.UnAckQueue) error { uaq.RWMutex.Lock() if len(uaq.Uslice) <= 0 { @@ -100,7 +101,7 @@ func SendMissingStz(lastSent int, s Sender, uaq *stanza.UnAckQueue) error { } } - // Ask for updates on stanzas we just sent to the entity + // Ask for updates on stanzas we just sent to the entity. Not sure I should leave this. Maybe let users call ack again by themselves ? s.Send(stanza.SMRequest{}) } uaq.RWMutex.Unlock()