4. In $\triangle A B C$, if $(\sin A+\sin B)(\cos A+\cos B)=2 \sin C$, then $\triangle A B C(\quad)$.
A. is an isosceles triangle but not necessarily a right triangle
B. is a right triangle but not necessarily an isosceles triangle
C. is neither an isosceles triangle nor a right triangle
D. is both an isosceles triangle and a right triangle