@@ -337,29 +337,21 @@ if(method.removingInactiveFriendsEnabled()) {
337337 } , 1000 * 60 * 60 ) ;
338338}
339339
340- // Code for declining random group invites
341-
342- if ( method . DecliningRandomGroupInvites ( ) ) {
343- refloow . on ( 'groupRelationship' , function ( sid , REL ) {
344- if ( REL == SteamUser . EClanRelationship . Invited ) {
345- logcolors . info ( '| [Steam] |: We were asked to join steam group #' + sid ) ; //cyan
346- refloow . respondToGroupInvite ( sid , false ) ;
347- logcolors . false ( '| [Steam] |: Declined incoming group invite.' ) ;
348- }
349- } ) ;
350- }
351-
352- // Code for accepting random group invites
353-
354- if ( method . AcceptingRandomGroupInvites ( ) ) {
355- refloow . on ( 'groupRelationship' , function ( sid , REL ) {
356- if ( REL == SteamUser . EClanRelationship . Invited ) {
357- logcolors . info ( '| [Steam] |: We were asked to join steam group #' + sid ) ; //cyan
358- refloow . respondToGroupInvite ( sid , true ) ;
359- logcolors . true ( '| [Steam] |: Accepting incoming group invite.' ) ;
360- }
361- } ) ;
362- }
340+ // Handling random group invites safely
341+ refloow . on ( 'groupRelationship' , function ( sid , REL ) {
342+ if ( REL == SteamUser . EClanRelationship . Invited ) {
343+ logcolors . info ( '| [Steam] |: We were asked to join steam group #' + sid ) ;
344+
345+ // Checks the single config setting to decide what to do
346+ if ( CONFIG . accept_random_group_inv === true ) {
347+ refloow . respondToGroupInvite ( sid , true ) ;
348+ logcolors . true ( '| [Steam] |: Accepted incoming group invite.' ) ;
349+ } else {
350+ refloow . respondToGroupInvite ( sid , false ) ;
351+ logcolors . false ( '| [Steam] |: Declined incoming group invite.' ) ;
352+ }
353+ }
354+ } ) ;
363355
364356// Spam protection logic
365357
0 commit comments