| 1162 | } |
| 1163 | |
| 1164 | char *GetChannelByUser(const char *nickname) { |
| 1165 | char szWhoisCmd[100]; |
| 1166 | |
| 1167 | if (nickname == (char *)-1) { |
| 1168 | GettingUserChannel = 0; |
| 1169 | Getting_user_channel_error = 0; |
| 1170 | return nullptr; |
| 1171 | } else if (GettingUserChannel) { |
| 1172 | if (Getting_user_channel_error) { |
| 1173 | Getting_user_channel_error = 0; |
| 1174 | GettingUserChannel = 0; |
| 1175 | return (char *)-1; |
| 1176 | } |
| 1177 | if (*User_req_channel) { |
| 1178 | GettingUserChannel = 0; |
| 1179 | return User_req_channel; |
| 1180 | } |
| 1181 | } else { |
| 1182 | strcpy(Getting_user_channel_info_for, nickname); |
| 1183 | User_req_channel[0] = '\0'; |
| 1184 | snprintf(szWhoisCmd, sizeof(szWhoisCmd), "/WHOIS %s", nickname); |
| 1185 | SendChatString(szWhoisCmd, 1); |
| 1186 | GettingUserChannel = 1; |
| 1187 | } |
| 1188 | return nullptr; |
| 1189 | } |
no test coverage detected