message_fetch: Refactor get_base_query_for_search.
message_fetch: Refactor get_base_query_for_search.

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