Added pgp checks for message sending
This commit is contained in:
@@ -103,6 +103,49 @@ message_send_chat(const char * const barejid, const char * const msg)
|
||||
|
||||
char *id = create_unique_id("msg");
|
||||
xmpp_stanza_t *message = NULL;
|
||||
message = stanza_create_message(ctx, id, jid, STANZA_TYPE_CHAT, msg);
|
||||
|
||||
free(jid);
|
||||
|
||||
if (state) {
|
||||
stanza_attach_state(ctx, message, state);
|
||||
}
|
||||
if (prefs_get_boolean(PREF_RECEIPTS_REQUEST)) {
|
||||
stanza_attach_receipt_request(ctx, message);
|
||||
}
|
||||
|
||||
xmpp_send(conn, message);
|
||||
xmpp_stanza_release(message);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
char *
|
||||
message_send_chat_pgp(const char * const barejid, const char * const msg)
|
||||
{
|
||||
xmpp_conn_t * const conn = connection_get_conn();
|
||||
xmpp_ctx_t * const ctx = connection_get_ctx();
|
||||
|
||||
ChatSession *session = chat_session_get(barejid);
|
||||
char *state = NULL;
|
||||
char *jid = NULL;
|
||||
if (session) {
|
||||
if (prefs_get_boolean(PREF_STATES) && session->send_states) {
|
||||
state = STANZA_NAME_ACTIVE;
|
||||
}
|
||||
Jid *jidp = jid_create_from_bare_and_resource(session->barejid, session->resource);
|
||||
jid = strdup(jidp->fulljid);
|
||||
jid_destroy(jidp);
|
||||
|
||||
} else {
|
||||
if (prefs_get_boolean(PREF_STATES)) {
|
||||
state = STANZA_NAME_ACTIVE;
|
||||
}
|
||||
jid = strdup(barejid);
|
||||
}
|
||||
|
||||
char *id = create_unique_id("msg");
|
||||
xmpp_stanza_t *message = NULL;
|
||||
|
||||
#ifdef HAVE_LIBGPGME
|
||||
char *account_name = jabber_get_account_name();
|
||||
@@ -137,6 +180,7 @@ message_send_chat(const char * const barejid, const char * const msg)
|
||||
if (state) {
|
||||
stanza_attach_state(ctx, message, state);
|
||||
}
|
||||
stanza_attach_carbons_private(ctx, message);
|
||||
if (prefs_get_boolean(PREF_RECEIPTS_REQUEST)) {
|
||||
stanza_attach_receipt_request(ctx, message);
|
||||
}
|
||||
@@ -148,7 +192,7 @@ message_send_chat(const char * const barejid, const char * const msg)
|
||||
}
|
||||
|
||||
char *
|
||||
message_send_chat_encrypted(const char * const barejid, const char * const msg)
|
||||
message_send_chat_otr(const char * const barejid, const char * const msg)
|
||||
{
|
||||
xmpp_conn_t * const conn = connection_get_conn();
|
||||
xmpp_ctx_t * const ctx = connection_get_ctx();
|
||||
|
||||
@@ -146,7 +146,8 @@ GList * jabber_get_available_resources(void);
|
||||
|
||||
// message functions
|
||||
char* message_send_chat(const char * const barejid, const char * const msg);
|
||||
char* message_send_chat_encrypted(const char * const barejid, const char * const msg);
|
||||
char* message_send_chat_otr(const char * const barejid, const char * const msg);
|
||||
char* message_send_chat_pgp(const char * const barejid, const char * const msg);
|
||||
void message_send_private(const char * const fulljid, const char * const msg);
|
||||
void message_send_groupchat(const char * const roomjid, const char * const msg);
|
||||
void message_send_groupchat_subject(const char * const roomjid, const char * const subject);
|
||||
|
||||
Reference in New Issue
Block a user