Skip to content

Commit

Permalink
Merge pull request #2 from symcon/fixes/unregister-messages
Browse files Browse the repository at this point in the history
properly unregister messages (PHP-169)
  • Loading branch information
DrNiels committed Dec 11, 2020
2 parents a6e50ce + 4d357cb commit e8b7790
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion LogikGatter/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ public function ApplyChanges()
//Never delete this line!
parent::ApplyChanges();

//Delete all registrations in order to readd them
foreach ($this->GetMessageList() as $senderID => $messages) {
foreach ($messages as $message) {
$this->UnregisterMessage($senderID, $message);
}
}
foreach (json_decode($this->ReadPropertyString('Input'), true) as $input) {
$this->RegisterMessage($input['ID'], 10603);
$this->RegisterMessage($input['ID'], VM_UPDATE);
}

$this->UpdateOutput();
Expand Down

0 comments on commit e8b7790

Please sign in to comment.