comparison mcabber/src/screen.c @ 996:f4d6570e2628

Chatstates: display contact chatstate in the chat status bar
author Mikael Berthe <mikael@lilotux.net>
date Thu, 02 Nov 2006 21:59:15 +0100
parents 0759f4c7da68
children d0d0cd9e39c4
comparison
equal deleted inserted replaced
995:c89e7993c4d9 996:f4d6570e2628
1087 buf_locale = from_utf8(buf); 1087 buf_locale = from_utf8(buf);
1088 mvwprintw(chatstatusWnd, 0, 1, "%s", buf_locale); 1088 mvwprintw(chatstatusWnd, 0, 1, "%s", buf_locale);
1089 g_free(buf_locale); 1089 g_free(buf_locale);
1090 g_free(buf); 1090 g_free(buf);
1091 1091
1092 // Display chatstates of the contact, if available.
1093 if (btype & ROSTER_TYPE_USER) {
1094 char eventchar = 0;
1095 guint event;
1096
1097 // We do not specify the resource here, so one of the resources with the
1098 // highest priority will be used.
1099 event = buddy_resource_getevents(BUDDATA(current_buddy), NULL);
1100
1101 if (event == ROSTER_EVENT_ACTIVE)
1102 eventchar = 'A';
1103 else if (event == ROSTER_EVENT_COMPOSING)
1104 eventchar = 'C';
1105 else if (event == ROSTER_EVENT_PAUSED)
1106 eventchar = 'P';
1107 else if (event == ROSTER_EVENT_INACTIVE)
1108 eventchar = 'I';
1109 else if (event == ROSTER_EVENT_GONE)
1110 eventchar = 'G';
1111
1112 if (eventchar)
1113 mvwprintw(chatstatusWnd, 0, maxX-3, "[%c]", eventchar);
1114 }
1115
1116
1092 if (forceupdate) { 1117 if (forceupdate) {
1093 update_panels(); 1118 update_panels();
1094 } 1119 }
1095 } 1120 }
1096 1121