Yes he was because
Yes he was talking to the church, read the entire book of 1st john where was he when he said this? who were mostly there when he referenced this? He would not say if anyone claims to be without sin then the truth is not him to unbelievers because the truth was never in them to begin with so claiming to have no sin and thus the truth is not in them would be pointless because it is already known the truth is not in them.
You can claim to have no sin but that in itself is a sin, Yes we are made free in being born again we are not bound by the chains of sin and not to serve sin however Jesus said we would recieve a helper and one thing the spirit does is convict us when we sin.
If we claim to be without sin then when he does convict us we ignore him and maybe this isn't the case for you but my sin keeps me humble it makes me all the more grateful for what Jesus did for me. We go before him as humble servents we come to him with humble hearts knowing we are not worthy we come in rags and dirt because this is the image of one who is humble one who knows their weakness knows their need for him and yet beneath the rags and dirt is disguised a pure and holy king and queen.
We are to have a repentant heart but there is no repentance if we think there is no need for it is there?
This is what I see when I read it...
Chapter 1
6 "If we say that we have fellowship with him, and walk in darkness, we lie, and do not the truth:"
6. Not in him because we are either not saved or have not put on the new man.
7 "But if we walk in the light, as he is in the light, we have fellowship one with another, and the blood of Jesus Christ his Son cleanseth us from all sin."
7. In him because we are saved and have put on the new man.
8 "If we say that we have no sin, we deceive ourselves, and the truth is not in us."
8. Not in him because we are either not saved or have not put on the new man.
9 "If we confess our sins, he is faithful and just to forgive us our sins, and to cleanse us from all unrighteousness."
9. In him because we are saved and have put on the new man.
10 "If we say that we have not sinned, we make him a liar, and his word is not in us."
10. Not in him because we are either not saved or have not put on the new man.
Chapter 2
1 "My little children, these things write I unto you, that ye sin not. And if any man sin, we have an advocate with the Father, Jesus Christ the righteous:"
1. Not in him because we are either not saved or have not put on the new man.
2 "And he is the propitiation for our sins: and not for ours only, but also for the sins of the whole world."
2. Not in him because we are either not saved or have not put on the new man.
3 "And hereby we do know that we know him, if we keep his commandments."
3. In him because we are saved and have put on the new man.
4 "He that saith, I know him, and keepeth not his commandments, is a liar, and the truth is not in him."
4. Not in him because we are either not saved or have not put on the new man.
5 "But whoso keepeth his word, in him verily is the love of God perfected: hereby know we that we are in him."
5. In him because we are saved and have put on the new man.
6 "He that saith he abideth in him ought himself also so to walk, even as he walked."
6. In him because we are saved and have put on the new man.