| |
CBSpamFilter::CBSpamFilter() |
|
|
| Comments: |
| Constructor. |
| Sets the initial state of the Spam Filter. |
|
|
|
|
|
| |
|
| int |
CBSpamFilter::ClearFilter() |
|
|
| Comments: |
| Removes all entries from the Spam Filter. |
|
|
|
|
|
|
| |
|
| int |
CBSpamFilter::EnableSpamFilter( |
int bEnableFlag = CB_TRUE) |
|
| Comments: |
| Enables or Disables the Spam Filter depending on if
TRUE or FALSE is passed in. |
| No Parameters means to Enable the filter. |
| When the Spam Filter is enabled, Chat Messages
containing strings found in the Spam Filter are
discarded and are not displayed. |
|
| Parameters: |
| bEnableFlag |
| TRUE or FALSE flag to
specify if the Filter should be Enabled or
Disabled. Defaults to CB_TRUE. |
|
|
|
|
|
|
|
| Returns: |
| CB_SUCCESS regardless of if the Filter is Enabled or
Disabled. |
|
| |
|
| int |
CBSpamFilter::DisableSpamFilter() |
|
|
| Comments: |
| Turns off the Spam Filter. |
| With the Spam Filter disabled, Spam messages may be
shown. |
|
|
|
|
|
| |
|
| int |
CBSpamFilter::AddString( |
CBSTRING sString) |
|
| Comments: |
| Adds a string to the Spam Filter. |
| Any Chat Messages containing strings found in the Spam
Filter are blocked and discarded and are not displayed
(provided the Spam Filter is enabled). |
| Phrases (strings containing spaces) may be
added. |
| Strings are converted to UPPERCASE before
storage. Filtering is not Case Sensitive so Spam words are filtered out regardless of Case. |
|
| Parameters: |
| sString |
| A String representing
a spam string to add to the Spam Filter. |
|
|
|
| Returns: |
| CB_ERROR_EMPTY_STRING if sString is empty. |
| CB_SUCCESS if the word was added to the Spam Filter |
|
| |
|
| int |
CBSpamFilter::RemoveString( |
CBSTRING sString) |
|
| Comments: |
| Removes a string from the Spam Filter. |
| All strings are stored in the Spam Filter in
UPPERCASE. sString is converted to UPPERCASE
before searching for it for removal. |
|
| Parameters: |
| sString |
| The String to remove
from the Spam Filter |
|
|
|
|
|
|
|
| Returns: |
| CB_SUCCESS regardless of if the string was already in
the Spam Filter or not. |
|
| |
|
|
|
| Comments: |
| Applies the Spam Filter to the Chat Message.
If the Spam Filter is enabled and cbcmChatMessage
contains any strings found in the Spam Filter (m_SpamStringSet),
then this function shall return CB_TRUE. |
| If the Spam Filter is disabled and/or cbcmChatMessage
does not contain any strings found in the Spam Filter,
then this function returns CB_FALSE. |
| Filtering is not Case
Sensitive. |
| The filtering is string based, and not word based,
meaning that if a substring is found which matches any
string in the Spam Filter (even if it is a portion of a
larger word) then this function shall return CB_TRUE if
the Spam Filter is enabled. |
| cbcmChatMessage typically represents a Chat Message
for which one wishes to determine if it contains Spam or
not. |
| This function calls CBChatMessage::GetRawChatString()
to get the Chat Text out of the Chat
Message. |
| Called by CBChatHandler::IsDisplayableChatMessage(). |
|
|
| Parameters: |
| cbcmChatMessage |
| A CBChatMessage instance
which may or may not contain Spam |
|
| |
|
| Returns: |
| CB_TRUE if the Spam Filter is enabled and cbcmChatMessage
contains a string found in m_SpamStringSet. |
| CB_FALSE if the Spam Filter is disabled or cbcmChatMessage
does not contain any Spam. |
|
| |
|
| |