« Back to Product

Documentation

UnregisterMessage

Require: IP-Symcon >= 4.1

 boolean UnregisterMessage (int $SenderID, int $MessageID) 

Parameters

SenderID

ID of the sender

MessageID

ID of the message

Returns

If the command succeeds, it returns TRUE, otherwise FALSE.

Description

This function removes a registration of the module for receiving the message MessageID and the ID SenderID.
A list of the MessageIDs can be found here: Messages

Example

// The module no longer "listens" for messages from instance 12345 with MessageID 10505
$this->UnregisterMessage(12345 /* InstanceID */, 10505 /* IM_CHANGESTATUS */);

// All messages from the module should be deleted 
foreach ($this->GetMessageList() as $senderID => $messages) {
    foreach ($messages as $message) {
        $this->UnregisterMessage($senderID, $message);
    }
}
Any questions?