diff options
author | Ray Strode <rstrode@redhat.com> | 2023-02-20 14:32:52 -0500 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2023-02-22 15:02:19 -0500 |
commit | 7a09a948a6435af00783c0e44582333600a792b3 (patch) | |
tree | 61a80f38136c041d0d57fc53e8fd8fa6bb038dbf | |
parent | 820b62c1a29340dd0aecb8460f9aec5185516c07 (diff) | |
download | gnome-online-accounts-7a09a948a6435af00783c0e44582333600a792b3.tar.gz |
goakerberosidentity: Queue is-signed-in notify before emitting expired signal
Right now the "expired" signal is emitted before the "is-signed-in"
property notification is queued. This notification is used to update the
"IsSignedIn" property of the object on the bus. The "expired" signal
emission leads to a corresponding "identity-expired" signal on the manager
object. A handler for that signal calls into gnome-online-accounts to check
identity status. In response, gnome-online-accounts will check the "IsSignedIn"
property.
This commit makes sure the "is-signed-in" notification is queued first,
before the "expired" signal is emitted.
Of course queuing the notify before "expired" is emitted isn't enough to
ensure the notify happens in time. A future commit will make sure the
"identity-expired" signal itself is deferred to the main thread, which
should resolve that problem.
-rw-r--r-- | src/goaidentity/goakerberosidentity.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/goaidentity/goakerberosidentity.c b/src/goaidentity/goakerberosidentity.c index de646d5..0eb0a9c 100644 --- a/src/goaidentity/goakerberosidentity.c +++ b/src/goaidentity/goakerberosidentity.c @@ -1055,31 +1055,21 @@ out: if (best_verification_level != old_verification_level) { + G_LOCK (identity_lock); + self->cached_verification_level = best_verification_level; + queue_notify (self, &self->is_signed_in_idle_id, "is-signed-in"); + G_UNLOCK (identity_lock); + if (old_verification_level == VERIFICATION_LEVEL_SIGNED_IN && best_verification_level == VERIFICATION_LEVEL_EXISTS) { - G_LOCK (identity_lock); - self->cached_verification_level = best_verification_level; - G_UNLOCK (identity_lock); - g_signal_emit (G_OBJECT (self), signals[EXPIRED], 0); } else if (old_verification_level == VERIFICATION_LEVEL_EXISTS && best_verification_level == VERIFICATION_LEVEL_SIGNED_IN) { - G_LOCK (identity_lock); - self->cached_verification_level = best_verification_level; - G_UNLOCK (identity_lock); - g_signal_emit (G_OBJECT (self), signals[UNEXPIRED], 0); } - else - { - G_LOCK (identity_lock); - self->cached_verification_level = best_verification_level; - G_UNLOCK (identity_lock); - } - queue_notify (self, &self->is_signed_in_idle_id, "is-signed-in"); } default_principal = get_default_principal (self); |