topic: Refactor get_topic_history_for_stream.
topic: Refactor get_topic_history_for_stream.

This now uses get_topic_history_for_public_stream as a subroutine, to
avoid duplicating that large section of SQL.

hackerkid/zulip,showell/zulip,rht/zulip,zulip/zulip,eeshangarg/zulip,eeshangarg/zulip,andersk/zulip,kou/zulip,hackerkid/zulip,hackerkid/zulip,rht/zulip,showell/zulip,kou/zulip,eeshangarg/zulip,punchagan/zulip,zulip/zulip,zulip/zulip,punchagan/zulip,rht/zulip,rht/zulip,andersk/zulip,rht/zulip,punchagan/zulip,hackerkid/zulip,hackerkid/zulip,zulip/zulip,showell/zulip,eeshangarg/zulip,zulip/zulip,kou/zulip,punchagan/zulip,rht/zulip,zulip/zulip,hackerkid/zulip,punchagan/zulip,kou/zulip,zulip/zulip,rht/zulip,andersk/zulip,showell/zulip,punchagan/zulip,showell/zulip,showell/zulip,andersk/zulip,punchagan/zulip,showell/zulip,andersk/zulip,eeshangarg/zulip,hackerkid/zulip,andersk/zulip,kou/zulip,kou/zulip,andersk/zulip,eeshangarg/zulip,kou/zulip,eeshangarg/zulip