mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Use null check convention in otrlibv3.c
This commit is contained in:
parent
a979d23e10
commit
2426a7fcfc
@ -87,7 +87,7 @@ otrlib_end_session(OtrlUserState user_state, const char * const recipient, char
|
|||||||
ConnContext *context = otrl_context_find(user_state, recipient, jid, "xmpp",
|
ConnContext *context = otrl_context_find(user_state, recipient, jid, "xmpp",
|
||||||
0, NULL, NULL, NULL);
|
0, NULL, NULL, NULL);
|
||||||
|
|
||||||
if (context != NULL) {
|
if (context) {
|
||||||
otrl_message_disconnect(user_state, ops, NULL, jid, "xmpp", recipient);
|
otrl_message_disconnect(user_state, ops, NULL, jid, "xmpp", recipient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,7 +171,7 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
|||||||
} else {
|
} else {
|
||||||
context->smstate->nextExpected = OTRL_SMP_EXPECT1;
|
context->smstate->nextExpected = OTRL_SMP_EXPECT1;
|
||||||
if (context->smstate->received_question == 0) {
|
if (context->smstate->received_question == 0) {
|
||||||
if ((context->active_fingerprint->trust != NULL) && (context->active_fingerprint->trust[0] != '\0')) {
|
if (context->active_fingerprint->trust && (context->active_fingerprint->trust[0] != '\0')) {
|
||||||
ui_smp_successful(context->username);
|
ui_smp_successful(context->username);
|
||||||
ui_trust(context->username);
|
ui_trust(context->username);
|
||||||
} else {
|
} else {
|
||||||
@ -193,7 +193,7 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
|||||||
otrl_message_abort_smp(user_state, ops, NULL, context);
|
otrl_message_abort_smp(user_state, ops, NULL, context);
|
||||||
} else {
|
} else {
|
||||||
context->smstate->nextExpected = OTRL_SMP_EXPECT1;
|
context->smstate->nextExpected = OTRL_SMP_EXPECT1;
|
||||||
if ((context->active_fingerprint->trust != NULL) && (context->active_fingerprint->trust[0] != '\0')) {
|
if (context->active_fingerprint->trust && (context->active_fingerprint->trust[0] != '\0')) {
|
||||||
ui_smp_successful(context->username);
|
ui_smp_successful(context->username);
|
||||||
ui_trust(context->username);
|
ui_trust(context->username);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user