about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--TODO_0453
-rw-r--r--src/server_events.c2
-rw-r--r--src/ui/core.c13
-rw-r--r--src/ui/ui.h4
4 files changed, 15 insertions, 7 deletions
diff --git a/TODO_045 b/TODO_045
index 4457843a..f962f9a4 100644
--- a/TODO_045
+++ b/TODO_045
@@ -1,4 +1,5 @@
-Show occupants role and affiliation when they join room
+Show own role affilaition changes (including actor/reason)
+Show occupants role and affiliation changes (including actor/reason)
 Check all commands from private conversations                                                                      
 Test all freetext args     
 Make form editing commands less verbose
diff --git a/src/server_events.c b/src/server_events.c
index 3d949430..3916fc41 100644
--- a/src/server_events.c
+++ b/src/server_events.c
@@ -752,7 +752,7 @@ handle_muc_occupant_online(const char * const room, const char * const nick, con
     if (!existing) {
         char *muc_status_pref = prefs_get_string(PREF_STATUSES_MUC);
         if (g_strcmp0(muc_status_pref, "none") != 0) {
-            ui_room_member_online(room, nick, show, status);
+            ui_room_member_online(room, nick, role, affiliation, show, status);
         }
         prefs_free_string(muc_status_pref);
         ui_muc_roster(room);
diff --git a/src/ui/core.c b/src/ui/core.c
index 67a8f1a1..eed865bb 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -1508,14 +1508,21 @@ _ui_room_member_banned(const char * const room, const char * const nick, const c
 }
 
 static void
-_ui_room_member_online(const char * const room, const char * const nick,
-    const char * const show, const char * const status)
+_ui_room_member_online(const char * const room, const char * const nick, const char * const role,
+    const char * const affiliation, const char * const show, const char * const status)
 {
     ProfWin *window = wins_get_by_recipient(room);
     if (window == NULL) {
         log_error("Received online presence for room participant %s, but no window open for %s.", nick, room);
     } else {
-        win_save_vprint(window, '!', NULL, 0, COLOUR_ONLINE, "", "-> %s has joined the room.", nick);
+        win_save_vprint(window, '!', NULL, NO_EOL, COLOUR_ONLINE, "", "-> %s has joined the room", nick);
+        if (role) {
+            win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, COLOUR_ONLINE, "", ", role: %s", role);
+        }
+        if (affiliation) {
+            win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, COLOUR_ONLINE, "", ", affiliation: %s", affiliation);
+        }
+        win_save_print(window, '!', NULL, NO_DATE, COLOUR_ROOMINFO, "", "");
     }
 }
 
diff --git a/src/ui/ui.h b/src/ui/ui.h
index add0a3d2..46582549 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -158,8 +158,8 @@ void (*ui_leave_room)(const char * const room);
 void (*ui_room_broadcast)(const char * const room_jid,
     const char * const message);
 void (*ui_room_member_offline)(const char * const room, const char * const nick);
-void (*ui_room_member_online)(const char * const room,
-    const char * const nick, const char * const show, const char * const status);
+void (*ui_room_member_online)(const char * const room, const char * const nick, const char * const roles,
+    const char * const affiliation, const char * const show, const char * const status);
 void (*ui_room_member_nick_change)(const char * const room,
     const char * const old_nick, const char * const nick);
 void (*ui_room_nick_change)(const char * const room, const char * const nick);