The Chaldeans were invading Jerusalem when the Egyptian army started moving toward Jerusalem. The Chaldeans retreated and moved away. At that moment the king of Israel wanted to know if God had said something to Jeremiah. Jeremiah says yes! God did say something to me. He said do not be encouraged because the Chaldeans retreated. They will be back and they will burn Jerusalem to the ground. The message is consistent, but the king was hoping, just hoping, that somehow the message of destruction and doom had changed. But it had not. If you look at vs.10 you see the prophet said that even if the Chaldeans had only a handful of wounded men, they would still rise up and defeat you.
Jeremiah, in the meantime, is arrested for what looked like deserting Jerusalem to help the Chaldeans when he was just trying to claim his land as a rightful heir. As a result he is thrown into prison and remains in prison for much of the rest of this writing.