get_device_browser: Fix browser string for mobile.

Now get_device_browser() returns 'Zulip' for 'ZulipAndroid' and
'ZulipMobile'.
This commit is contained in:
Umair Khan 2017-06-16 09:04:59 +05:00 committed by Tim Abbott
parent b9c69004e4
commit 7e43cd5624
2 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,8 @@ def get_device_browser(user_agent):
return "Internet Explorer"
elif "edge" in user_agent:
return "Edge"
elif "zulip" in user_agent:
return "Zulip"
else:
return None

View File

@ -87,6 +87,8 @@ class TestBrowserAndOsUserAgentStrings(ZulipTestCase):
('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) ' +
'AppleWebKit/602.3.12 (KHTML, like Gecko) ' +
'Version/10.0.2 Safari/602.3.12', 'Safari', 'MacOS'),
('ZulipAndroid/1.0', 'Zulip', 'Android'),
('ZulipMobile/1.0', 'Zulip', None),
('', None, None),
]