I am using "Execute custom PHP" as a condition in a Rule which is being triggered when a new Status is saved. Here is the PHP I am using, it keeps causing "Trying to get property of non-object" errors whenever I create a new status:
if($sender->uid == $recipient-id){
return TRUE;
} else {
return FALSE;
}
Basically what I am trying to do is detect cases when the sender is sending a status message to himself so I can use an appropriate Rules action, and also the opposite:
if($sender->uid != $recipient-id){
return TRUE;
} else {
return FALSE;
}
I have tried a number of different variable combinations but I can't work out what I am doing wrong. Any suggestions?