Jump to content

New unused variable in "\applications\core\sources\Messenger\Conversation::memberCanReceiveNewMe()"?


Go to solution Solved by Daniel F,

Recommended Posts

Posted

In the mentioned function \applications\core\sources\Messenger\Conversation::memberCanReceiveNewMe() you added a new $type parameter but it's not checked anywhere in the function itself?

 

	/**
	 * Check if a member can receive new messages
	 *
	 * @param	\IPS\Member	$member	The member to check
	 * @param	\IPS\Member	$sender	The member sending the new message
	 * @param	string		$type	Type of message to check (new, reply)
	 
	 * @return	bool
	 */
	public static function memberCanReceiveNewMessage( \IPS\Member $member, \IPS\Member $sender, $type='new' )
	{
		/* Messenger is hard disabled */
		if ( $member->members_disable_pm == 2 )
		{
			return FALSE;
		}
		else if ( $member->members_disable_pm == 1 )
		{
			/* We will allow moderators */
			return $sender->modPermissions() !== FALSE;
		}
		
		/* Group can not use messenger */
		if ( !$member->canAccessModule( \IPS\Application\Module::get( 'core', 'messaging' ) ) )
		{
			return FALSE;
		}
		
		/* Inbox is full */
		if ( ( $member->group['g_max_messages'] > 0 AND $member->msg_count_total >= $member->group['g_max_messages'] ) and !$sender->group['gbw_pm_override_inbox_full'] )
		{
			return FALSE;
		}
		
		/* Is being ignored */
		if ( $member->isIgnoring( $sender, 'messages' ) )
		{
			return FALSE;
		}
		
		
		return TRUE;
	}

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...