Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Plugins
pidgin-otr
Commits
3b28f835
Commit
3b28f835
authored
Oct 27, 2005
by
cypherpunk
Browse files
Reinstate sending of TLV_DISCONNECT at gaim quit time, but only for v2
sessions (which can handle it).
parent
c4f9bd72
Changes
1
Hide whitespace changes
Inline
Side-by-side
otr-plugin.c
View file @
3b28f835
...
...
@@ -509,6 +509,20 @@ TrustLevel otrg_plugin_context_to_trust(ConnContext *context)
return
level
;
}
/* Send the OTRL_TLV_DISCONNECTED packets when we're about to quit. */
static
void
process_quitting
(
void
)
{
ConnContext
*
context
=
otrg_plugin_userstate
->
context_root
;
while
(
context
)
{
ConnContext
*
next
=
context
->
next
;
if
(
context
->
msgstate
==
OTRL_MSGSTATE_ENCRYPTED
&&
context
->
protocol_version
>
1
)
{
otrg_plugin_disconnect
(
context
);
}
context
=
next
;
}
}
static
guint
button_type_cbid
;
static
gboolean
otr_plugin_load
(
GaimPlugin
*
handle
)
...
...
@@ -518,6 +532,7 @@ static gboolean otr_plugin_load(GaimPlugin *handle)
void
*
conv_handle
=
gaim_conversations_get_handle
();
void
*
conn_handle
=
gaim_connections_get_handle
();
void
*
blist_handle
=
gaim_blist_get_handle
();
void
*
core_handle
=
gaim_get_core
();
if
(
!
privkeyfile
||
!
storefile
)
{
g_free
(
privkeyfile
);
...
...
@@ -538,6 +553,8 @@ static gboolean otr_plugin_load(GaimPlugin *handle)
otrg_ui_update_fingerprint
();
gaim_signal_connect
(
core_handle
,
"quitting"
,
otrg_plugin_handle
,
GAIM_CALLBACK
(
process_quitting
),
NULL
);
gaim_signal_connect
(
conv_handle
,
"sending-im-msg"
,
otrg_plugin_handle
,
GAIM_CALLBACK
(
process_sending_im
),
NULL
);
gaim_signal_connect
(
conv_handle
,
"receiving-im-msg"
,
otrg_plugin_handle
,
...
...
@@ -564,11 +581,14 @@ static gboolean otr_plugin_unload(GaimPlugin *handle)
void
*
conv_handle
=
gaim_conversations_get_handle
();
void
*
conn_handle
=
gaim_connections_get_handle
();
void
*
blist_handle
=
gaim_blist_get_handle
();
void
*
core_handle
=
gaim_get_core
();
/* Clean up all of our state. */
otrl_userstate_free
(
otrg_plugin_userstate
);
otrg_plugin_userstate
=
NULL
;
gaim_signal_disconnect
(
core_handle
,
"quitting"
,
otrg_plugin_handle
,
GAIM_CALLBACK
(
process_quitting
));
gaim_signal_disconnect
(
conv_handle
,
"sending-im-msg"
,
otrg_plugin_handle
,
GAIM_CALLBACK
(
process_sending_im
));
gaim_signal_disconnect
(
conv_handle
,
"receiving-im-msg"
,
otrg_plugin_handle
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment