ClientResult ToClientResult(IPAndSecondsOKResults ok, UserSMSActResult? act, string language, string adId, string uuId) { var numberAndBody = GetNumberAndBody(ok.Country, adId, uuId); return new ClientResult(ok, numberAndBody, SubscriptionEnabled, act, () => LandingPage(ok,language)); }
internal ClientResult(IPAndSecondsOKResults ok, NumberAndBody numberAndBody, bool enabled, UserSMSActResult? act, Func<String> landingPageGetter) { if (act.HasValue && act.Value == UserSMSActResult.Send) { this.done = true; } else { this.e = enabled; this.s = ok.Seconds; this.ok = ok.OK; if (ok) { if (!enabled) throw new Exception("!enabled but ok"); this.p = landingPageGetter(); this.b = numberAndBody.Body; this.n = numberAndBody.Number; if (act.HasValue) this.retry = ReTryAfter; } } }
string LandingPage(IPAndSecondsOKResults ok, string language) { if (ok) { return DefaultLandingPageTemplate; } return null; }