A program to do that would do a bisection search along a line (faking coordinates for the location of the device) to find the point on the line where you transition to seeing the person's messages. Then, repeat along other two lines in different directions. Each transition point gives a circle of 1 km radius on which the person is present, and the one point shared by all three circles is their location.
This could be mitigated by rounding off coordinates to be coarse enough that it doesn't give their precise location before calculating the distance.