about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-03-22 00:20:29 +0000
committerJames Booth <boothj5@gmail.com>2016-03-22 00:20:29 +0000
commit6f537c38186b3cdc4c63e11a327f367723ecffbd (patch)
tree45cfe2af588e8922a524425168c0d58d80716750 /src/ui
parent9d782fa665689851f9510e086ac12a9c44b6b74e (diff)
downloadprofani-tty-6f537c38186b3cdc4c63e11a327f367723ecffbd.tar.gz
Add PGP decryption for incoming/outgoing carbons
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/chatwin.c9
-rw-r--r--src/ui/ui.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c
index cbf0c93a..179e8a06 100644
--- a/src/ui/chatwin.c
+++ b/src/ui/chatwin.c
@@ -312,11 +312,16 @@ chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id,
 }
 
 void
-chatwin_outgoing_carbon(ProfChatWin *chatwin, const char *const message)
+chatwin_outgoing_carbon(ProfChatWin *chatwin, const char *const message, prof_enc_t enc_mode)
 {
     assert(chatwin != NULL);
 
-    win_print((ProfWin*)chatwin, '-', 0, NULL, 0, THEME_TEXT_ME, "me", message);
+    char enc_char = '-';
+    if (enc_mode == PROF_MSG_PGP) {
+        enc_char = prefs_get_pgp_char();
+    }
+
+    win_print((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message);
     int num = wins_get_num((ProfWin*)chatwin);
     status_bar_active(num);
 }
diff --git a/src/ui/ui.h b/src/ui/ui.h
index f8cb1de7..d5d741d6 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -131,7 +131,7 @@ void chatwin_incoming_msg(ProfChatWin *chatwin, const char *const resource, cons
 void chatwin_receipt_received(ProfChatWin *chatwin, const char *const id);
 void chatwin_recipient_gone(ProfChatWin *chatwin);
 void chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id, prof_enc_t enc_mode);
-void chatwin_outgoing_carbon(ProfChatWin *chatwin, const char *const message);
+void chatwin_outgoing_carbon(ProfChatWin *chatwin, const char *const message, prof_enc_t enc_mode);
 void chatwin_contact_online(ProfChatWin *chatwin, Resource *resource, GDateTime *last_activity);
 void chatwin_contact_offline(ProfChatWin *chatwin, char *resource, char *status);
 char* chatwin_get_string(ProfChatWin *chatwin);