Skip to content

fix(notifications): drop phone banners when the player carries no phone - #303

Merged
Github-Samuel merged 1 commit into
Samuels-Development:mainfrom
lGodHatesMel:fix/phone-less-notifications
Oct 6, 2026
Merged

Github-Samuel merged 1 commit into
Samuels-Development:mainfrom
lGodHatesMel:fix/phone-less-notifications

Conversation

@lGodHatesMel

Copy link
Copy Markdown
Contributor

Incoming messages (and every other app banner) still popped up for a player with no phone item, because the senders push sd-phone:client:notify without checking inventory.

Gate the banner at the client entry point instead of at each sender: the handler asks the new sd-phone:server:carriesPhone callback, which reads util.carriesPhone from the live inventory, and drops the banner when it returns false. Emergency alerts still get through, and servers with no Phone.Items configured are unaffected.

Message data is still delivered, so the text is there once a phone is picked up again; only the pop-up is suppressed.

Summary

Describe what this PR changes.

Type of Change

  • Bug Fix
  • New Feature
  • Improvement / Refactor
  • Performance
  • Documentation
  • Compatibility
  • Other

Related Issues

Closes #

or

Related to #

Testing

Describe how this was tested.

  • Tested locally
  • Tested with latest sd-phone
  • Tested with latest ox_lib
  • Tested with latest ox_inventory
  • Multiplayer tested

Breaking Changes

Does this introduce any breaking changes?

If yes, explain.


Checklist

  • My code follows the existing style of the project.
  • I have tested my changes.
  • I have updated any necessary documentation.
  • I have removed any debug code.
  • This PR does not include unrelated changes.
  • I have verified this works on the latest version of sd-phone.

Incoming messages (and every other app banner) still popped up for a
player with no phone item, because the senders push sd-phone:client:notify
without checking inventory.

Gate the banner at the client entry point instead of at each sender: the
handler asks the new sd-phone:server:carriesPhone callback, which reads
util.carriesPhone from the live inventory, and drops the banner when it
returns false. Emergency alerts still get through, and servers with no
Phone.Items configured are unaffected.

Message data is still delivered, so the text is there once a phone is
picked up again; only the pop-up is suppressed.
@Github-Samuel
Github-Samuel merged commit b9cd0a6 into Samuels-Development:main Oct 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants