Skip to:
Content
Pages
Categories
Search
Top
Bottom

Opt out for new message notifications doesn't work (fix provided)

  • Avatar of Greg
    Greg
    Participant

    @rebootnow

    Posting this here in case someone would like to patch their current installation. I have also opened a ticket: http://trac.buddypress.org/ticket/1015

    Issue: Email notifications still get sent when a user opts out using the notification settings form. The bug is in the function that sends the mail, where there are two errors on the line that checks whether the user’s ‘notification_messages_new_message’ setting == “no”.

    Fix: Around line 12 in file “bp-messages-notifications.php”, in function “messages_notification_new_message”, the line is currently:

    if ( $message->sender_id == $recipient_ids[$i] 'no' == get_userdata( $recipient_ids[$i], 'notification-messages-new-message' ) ) continue;

    That should be changed to read:

    if ( $message->sender_id == $recipient_ids[$i] 'no' == get_usermeta( $recipient_ids[$i], 'notification_messages_new_message' ) ) continue;

    The two changes:

    - call function get_usermeta instead of get_userdata

    - underscores instead of dashes in the metadata string

You must be logged in to reply to this topic.