The Supreme Court has unanimously decided that Facebook text message alerts don’t violate laws against unwanted auto-dialed calls. The court ruled that a lower court defined illegal “robocalls” too broadly and that the term should only apply to systems that generate lists of numbers and call them indiscriminately, not a system that simply stores numbers and automatically calls them.

The lawsuit involves text messages that notify Facebook users of an attempted login. Its plaintiff, Noah Duguid, sued after receiving unwanted, erroneous notifications despite not having a Facebook account. Duguid argued that Facebook was violating the 1991 Telephone Consumer Protection Act (TCPA). An appeals court agreed, but the Supreme Court interpreted the law’s definitions differently.

Closely parsing the TCPA’s grammar, the court concluded that an illegal auto-dialing system “must use a random or sequential number generator,” and this definition “excludes equipment like Facebook’s login notification system, which does not use such technology.”

Facebook argued that the earlier court decision could have defined basic smartphone functions as illegal autodialers. The Supreme Court agreed. “Duguid’s interpretation of an autodialer would capture virtually all modern cell phones,” the opinion says. Although robocalls are a huge problem on American phone networks, it says “expanding the definition of an autodialer to encompass any equipment that merely stores and dials telephone numbers would take a chainsaw to these nuanced problems.” So it’s opting for a much more limited definition — both for Facebook and any similar future system.