comparison mcabber/src/screen.c @ 1484:7b36b91a4388

New UI message flag (O) when OTR is used When PGP is used, the flag is still '~'. When OTR is used (and PGP is not), the encryption flag is 'O'.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 20 Apr 2008 14:30:25 +0200
parents e74cc83e7158
children 0121b6f3047c
comparison
equal deleted inserted replaced
1483:e74cc83e7158 1484:7b36b91a4388
1017 dir = '<'; 1017 dir = '<';
1018 else if (line->flags & HBB_PREFIX_OUT) 1018 else if (line->flags & HBB_PREFIX_OUT)
1019 dir = '>'; 1019 dir = '>';
1020 g_snprintf(pref, preflen, "%s#%c# ", date, dir); 1020 g_snprintf(pref, preflen, "%s#%c# ", date, dir);
1021 } else if (line->flags & HBB_PREFIX_IN) { 1021 } else if (line->flags & HBB_PREFIX_IN) {
1022 char cryptflag = line->flags & HBB_PREFIX_PGPCRYPT ? '~' : '='; 1022 char cryptflag;
1023 if (line->flags & HBB_PREFIX_PGPCRYPT)
1024 cryptflag = '~';
1025 else if (line->flags & HBB_PREFIX_OTRCRYPT)
1026 cryptflag = 'O';
1027 else
1028 cryptflag = '=';
1023 g_snprintf(pref, preflen, "%s<%c= ", date, cryptflag); 1029 g_snprintf(pref, preflen, "%s<%c= ", date, cryptflag);
1024 } else if (line->flags & HBB_PREFIX_OUT) { 1030 } else if (line->flags & HBB_PREFIX_OUT) {
1025 char cryptflag = line->flags & HBB_PREFIX_PGPCRYPT ? '~' : '-'; 1031 char cryptflag;
1032 if (line->flags & HBB_PREFIX_PGPCRYPT)
1033 cryptflag = '~';
1034 else if (line->flags & HBB_PREFIX_OTRCRYPT)
1035 cryptflag = 'O';
1036 else
1037 cryptflag = '=';
1026 g_snprintf(pref, preflen, "%s-%c> ", date, cryptflag); 1038 g_snprintf(pref, preflen, "%s-%c> ", date, cryptflag);
1027 } else if (line->flags & HBB_PREFIX_SPECIAL) { 1039 } else if (line->flags & HBB_PREFIX_SPECIAL) {
1028 strftime(date, 30, getspectprefix(), localtime(&line->timestamp)); 1040 strftime(date, 30, getspectprefix(), localtime(&line->timestamp));
1029 g_snprintf(pref, preflen, "%s ", date); 1041 g_snprintf(pref, preflen, "%s ", date);
1030 } else { 1042 } else {
1988 void scr_WriteIncomingMessage(const char *jidfrom, const char *text, 2000 void scr_WriteIncomingMessage(const char *jidfrom, const char *text,
1989 time_t timestamp, guint prefix, unsigned mucnicklen) 2001 time_t timestamp, guint prefix, unsigned mucnicklen)
1990 { 2002 {
1991 if (!(prefix & 2003 if (!(prefix &
1992 ~HBB_PREFIX_NOFLAG & ~HBB_PREFIX_HLIGHT & ~HBB_PREFIX_HLIGHT_OUT & 2004 ~HBB_PREFIX_NOFLAG & ~HBB_PREFIX_HLIGHT & ~HBB_PREFIX_HLIGHT_OUT &
1993 ~HBB_PREFIX_PGPCRYPT)) 2005 ~HBB_PREFIX_PGPCRYPT & ~HBB_PREFIX_OTRCRYPT))
1994 prefix |= HBB_PREFIX_IN; 2006 prefix |= HBB_PREFIX_IN;
1995 2007
1996 scr_WriteMessage(jidfrom, text, timestamp, prefix, mucnicklen); 2008 scr_WriteMessage(jidfrom, text, timestamp, prefix, mucnicklen);
1997 } 2009 }
1998 2010