@@ -139,10 +139,10 @@ type Client struct {
139
139
ErrorHandler func (error )
140
140
141
141
// Post connection hook. This will be executed on first connection
142
- PostFirstConnHook func () error
142
+ PostConnectHook func () error
143
143
144
144
// Post resume hook. This will be executed after the client resumes a lost connection using StreamManagement (XEP-0198)
145
- PostReconnectHook func () error
145
+ PostResumeHook func () error
146
146
}
147
147
148
148
/*
@@ -213,7 +213,7 @@ func NewClient(config *Config, r *Router, errorHandler func(error)) (c *Client,
213
213
}
214
214
215
215
// Connect establishes a first time connection to a XMPP server.
216
- // It calls the PostFirstConnHook
216
+ // It calls the PostConnectHook
217
217
func (c * Client ) Connect () error {
218
218
err := c .connect ()
219
219
if err != nil {
@@ -223,8 +223,8 @@ func (c *Client) Connect() error {
223
223
// Do we need an option to avoid that or do we rely on client to send the presence itself ?
224
224
err = c .sendWithWriter (c .transport , []byte (InitialPresence ))
225
225
// Execute the post first connection hook. Typically this holds "ask for roster" and this type of actions.
226
- if c .PostFirstConnHook != nil {
227
- err = c .PostFirstConnHook ()
226
+ if c .PostConnectHook != nil {
227
+ err = c .PostConnectHook ()
228
228
if err != nil {
229
229
return err
230
230
}
@@ -287,8 +287,8 @@ func (c *Client) Resume() error {
287
287
}
288
288
// Execute post reconnect hook. This can be different from the first connection hook, and not trigger roster retrival
289
289
// for example.
290
- if c .PostReconnectHook != nil {
291
- err = c .PostReconnectHook ()
290
+ if c .PostResumeHook != nil {
291
+ err = c .PostResumeHook ()
292
292
}
293
293
return err
294
294
}
0 commit comments