@@ -1162,9 +1162,9 @@ static void groupchat_onGroupPeerJoin(ToxWindow *self, Tox *m, uint32_t groupnum
11621162 ++ chat -> max_idx ;
11631163 }
11641164
1165+ /* ignore join messages when we first connect to the group */
11651166 if (timed_out (chat -> time_connected , 60 )
1166- && user_settings -> show_group_connection_msg ==
1167- SHOW_GROUP_CONNECTION_MSG_ON ) { /* ignore join messages when we first connect to the group */
1167+ && user_settings -> show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON ) {
11681168 line_info_add (self , true, peer -> name , NULL , CONNECTION , 0 , GREEN , "has joined the room" );
11691169
11701170 write_to_log ("has joined the room" , peer -> name , self -> chatwin -> log , true);
@@ -1194,15 +1194,16 @@ void groupchat_onGroupPeerExit(ToxWindow *self, Tox *m, uint32_t groupnumber, ui
11941194 return ;
11951195 }
11961196
1197- if (exit_type != TOX_GROUP_EXIT_TYPE_SELF_DISCONNECTED ) {
1197+ if (exit_type != TOX_GROUP_EXIT_TYPE_SELF_DISCONNECTED
1198+ && user_settings -> show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON ) {
11981199 char log_str [TOX_MAX_NAME_LENGTH + MAX_STR_SIZE ];
11991200
12001201 if (length > 0 ) {
12011202 line_info_add (self , true, name , NULL , DISCONNECTION , 0 , RED , "[Quit]: %s" , part_message );
12021203 snprintf (log_str , sizeof (log_str ), "has left the room (%s)" , part_message );
12031204 write_to_log (log_str , name , self -> chatwin -> log , true);
12041205 sound_notify (self , silent , NT_WNDALERT_2 , NULL );
1205- } else if ( user_settings -> show_group_connection_msg == SHOW_GROUP_CONNECTION_MSG_ON ) {
1206+ } else {
12061207 const char * exit_string = get_group_exit_string (exit_type );
12071208 line_info_add (self , true, name , NULL , DISCONNECTION , 0 , RED , "[%s]" , exit_string );
12081209 snprintf (log_str , sizeof (log_str ), "[%s]" , exit_string );
0 commit comments