private void AddFollow(int cnnId, int channelId, int recHostId, Net_AddFollow msg) { Net_OnAddFollow oaf = new Net_OnAddFollow(); if (db.InsertFollow(msg.Token, msg.UsernameDiscriminatorOrEmail)) { oaf.Success = 0; if (Utility.IsEmail(msg.UsernameDiscriminatorOrEmail)) { // email oaf.Follow = db.FindAccountByEmail(msg.UsernameDiscriminatorOrEmail).GetAccount(); } else { string[] data = msg.UsernameDiscriminatorOrEmail.Split('#'); if (data[1] == null) { return; } else { oaf.Follow = db.FindAccountByUsernameAndDiscriminator(data[0], data[1]).GetAccount(); } } } SendClient(recHostId, cnnId, oaf); }
private void AddFollow(int connectionId, int channelId, int recievingHostId, Net_AddFollow msg) { Net_OnAddFollow rmsg = new Net_OnAddFollow(); if (db.InsertFollow(msg.Token, msg.UsernameDiscriminatorOrEmail)) { if (Utility.IsEmail(msg.UsernameDiscriminatorOrEmail)) { // this is email rmsg.Follow = db.FindAccountByEmail(msg.UsernameDiscriminatorOrEmail).GetAccount(); } else { // this is username string[] data = msg.UsernameDiscriminatorOrEmail.Split('#'); if (data[1] == null) { return; } rmsg.Follow = db.FindAccountByUsernameAndDiscriminator(data[0], data[1]).GetAccount(); } } SendClient(recievingHostId, connectionId, rmsg); }
public void SendAddFollow(string usernameOrEmail) { Net_AddFollow af = new Net_AddFollow(); af.Token = token; af.UsernameDiscriminatorOrEmail = usernameOrEmail; SendServer(af); }
public void SendAddFollow(string usernameOrEmail) { Net_AddFollow msg = new Net_AddFollow(); msg.Token = token; msg.UsernameDiscriminatorOrEmail = usernameOrEmail; SendServer(msg); }