From 7558c7364839bc9e6650762e1316b6809b97036d Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 21 Apr 2019 06:15:37 +0200 Subject: [PATCH] Reformatted switch. --- src/api/get_stream.cpp | 57 +++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/src/api/get_stream.cpp b/src/api/get_stream.cpp index a25ec31..8a65a8e 100644 --- a/src/api/get_stream.cpp +++ b/src/api/get_stream.cpp @@ -22,34 +22,45 @@ using namespace Mastodon; using std::cerr; void API::get_stream(const Mastodon::API::v1 &call, - const parameters ¶ms, - std::unique_ptr &ptr, - string &stream) + const parameters ¶ms, + std::unique_ptr &ptr, + string &stream) { string strcall = ""; switch (call) { - case v1::streaming_user: - strcall = "/api/v1/streaming/user"; - break; - case v1::streaming_public: - strcall = "/api/v1/streaming/public"; - break; - case v1::streaming_public_local: - strcall = "/api/v1/streaming/public/local"; - break; - case v1::streaming_hashtag: - strcall = "/api/v1/streaming/hashtag"; - break; - case v1::streaming_list: - strcall = "/api/v1/streaming/list"; - break; - default: - ttdebug << "ERROR: Invalid call.\n"; - stream = "event: ERROR\ndata: {\"error_code\":22}\n"; - return; - break; + case Mastodon::API::v1::streaming_user: + { + strcall = "/api/v1/streaming/user"; + break; + } + case v1::streaming_public: + { + strcall = "/api/v1/streaming/public"; + break; + } + case v1::streaming_public_local: + { + strcall = "/api/v1/streaming/public/local"; + break; + } + case v1::streaming_hashtag: + { + strcall = "/api/v1/streaming/hashtag"; + break; + } + case v1::streaming_list: + { + strcall = "/api/v1/streaming/list"; + break; + } + default: + { + ttdebug << "ERROR: Invalid call.\n"; + stream = "event: ERROR\ndata: {\"error_code\":22}\n"; + return; + } } if (params.size() > 0)