 +          delete $self->JidDB->{$forum}->{$nick};
 +       }
 +
++       if(defined $self->JidDB->{"jid_$forum"}->{$nick}) {
++          delete $self->JidDB->{"jid_$forum"}->{$nick};
++       }
++
 +       return;
 +    }
 +
 +    # "register" user on any other types
 +    $self->JidDB->{$forum}->{$nick} = 1;
++    $self->JidDB->{"jid_$forum"}->{$nick} = $real_jid;
 +
 +    # call SayTo subroutine if needed
-+    if(defined $self->SayToDB->{$forum}->{$nick}) {
++    if(defined $self->SayToDB->{$forum}->{lc($nick)}) {
 +       &{ $self->SayTo }($self, $forum, $nick);
 +    }
 +
      DEBUG("Presence From $from t=$type s=$status");
      DEBUG("Presence XML: " . $presence->GetXML());
  }
-@@ -896,7 +920,8 @@
+@@ -896,7 +929,8 @@
  Assures message size does not exceed a limit and chops it into pieces if need be.
  
  NOTE: non-printable characters (unicode included) will be stripped before sending to the server via:

 
     # Call the message callback if it's defined.
     if( defined $self->message_function) {
@@ -789,6 +794,25 @@
     my $status = $presence->GetStatus();
     $status = "." if(!defined $status);
 

 
 =cut
 
@@ -989,7 +1023,8 @@
 
     # Strip out anything that's not a printable character
     # Now with unicode support?
