Right on, the purpose is the key in determining if it's from God, if it passed the initial test.
Must be purposeful and line up within Biblical categories: exhortation (warning), encouragement or comfort to the believers.
When people have visions/dreams of comfort and prosperity for people who are living worldly... This is the most common form of false prophecy. Although I've seen others too. There was this guy on YouTube, a relatively young believer, prophesying pouring out of God's wrath on California (don't remember the vision exactly I think it prophesied and earthquake or such) at a certain date, and when it did not come to pass, instead of taking the video down, he just changed the date to a future one!!! (Sorry for the exclamation marks, I tend to get strong feelings about this kind of chutzpah) This is not how it works. In prophecy, there's no "misheard it", "got it wrong", and so on. False prophets usually operate to seek attention or draw people to give them money, but people without any of these motivations sometimes prophecy falsely, too. It is obvious that the vision came out of his own spirit and how he saw the people around him, after he got converted.