diff --git a/WhatsAppApi/Base/WhatsEventBase.cs b/WhatsAppApi/Base/WhatsEventBase.cs index 00f5501..e3a85b3 100644 --- a/WhatsAppApi/Base/WhatsEventBase.cs +++ b/WhatsAppApi/Base/WhatsEventBase.cs @@ -10,7 +10,7 @@ namespace WhatsAppApi public class WhatsEventBase : ApiBase { //events - public event ExceptionDelegate OnDisconnect; + public event Action OnDisconnect; protected void fireOnDisconnect(Exception ex) { if (this.OnDisconnect != null) @@ -19,7 +19,7 @@ protected void fireOnDisconnect(Exception ex) } } - public event NullDelegate OnConnectSuccess; + public event Action OnConnectSuccess; protected void fireOnConnectSuccess() { if (this.OnConnectSuccess != null) @@ -28,7 +28,7 @@ protected void fireOnConnectSuccess() } } - public event ExceptionDelegate OnConnectFailed; + public event Action OnConnectFailed; protected void fireOnConnectFailed(Exception ex) { if (this.OnConnectFailed != null) @@ -46,7 +46,7 @@ protected void fireOnLoginSuccess(string pn, byte[] data) } } - public event StringDelegate OnLoginFailed; + public event Action OnLoginFailed; protected void fireOnLoginFailed(string data) { if (this.OnLoginFailed != null) @@ -291,10 +291,7 @@ protected void fireOnGetGroupSubject(string gjid, string jid, string username, s //event delegates public delegate void OnContactNameDelegate(string from, string contactName); - public delegate void NullDelegate(); - public delegate void ExceptionDelegate(Exception ex); public delegate void LoginSuccessDelegate(string phoneNumber, byte[] data); - public delegate void StringDelegate(string data); public delegate void OnErrorDelegate(string id, string from, int code, string text); public delegate void OnGetMessageReceivedDelegate(string from, string id); public delegate void OnNotificationPictureDelegate(string type, string jid, string id); diff --git a/WhatsAppApi/Settings/WhatsConstants.cs b/WhatsAppApi/Settings/WhatsConstants.cs index 3d2371b..03f1bb1 100644 --- a/WhatsAppApi/Settings/WhatsConstants.cs +++ b/WhatsAppApi/Settings/WhatsConstants.cs @@ -42,8 +42,8 @@ public class WhatsConstants /// /// The whatsapp version the client complies to /// - //public const string WhatsAppVer = "2.11.426"; - public const string WhatsAppVer = "2.12.68"; + public const string WhatsAppVer = "2.11.339"; + //public const string WhatsAppVer = "2.12.68"; /// /// The port that needs to be connected to @@ -53,14 +53,15 @@ public class WhatsConstants /// /// iPhone device /// - //public const string Device = "Android"; - public const string Device = "S40"; + public const string Device = "IPhone"; + //public const string Device = "S40"; /// /// The useragent used for http requests /// - //public const string UserAgent = "WhatsApp/2.11.426 Android/4.0.4 Device/GalaxyS3"; - public const string UserAgent = "WhatsApp/2.12.68 S40Version/14.26 Device/Nokia302"; + public const string UserAgent = "WhatsApp/2.11.339 Apple-iPhone5C1/1001.525"; + //public const string UserAgent = "WhatsApp/2.11.339 Android/4.0.4 Device/GalaxyS3"; + //public const string UserAgent = "WhatsApp/2.12.68 S40Version/14.26 Device/Nokia302"; #endregion diff --git a/WhatsAppPort/WhatsMessageHandler.cs b/WhatsAppPort/WhatsMessageHandler.cs index 3a5651c..19c4d18 100644 --- a/WhatsAppPort/WhatsMessageHandler.cs +++ b/WhatsAppPort/WhatsMessageHandler.cs @@ -39,7 +39,7 @@ private void CheckIfUserRegisteredAndCreate(FMessage mess) return; var jidSplit = mess.identifier_key.remote_jid.Split('@'); - WhatsUser tmpWhatsUser = new WhatsUser(jidSplit[0], jidSplit[1], mess.identifier_key.serverNickname); + WhatsUser tmpWhatsUser = new WhatsUser(jidSplit[0], jidSplit[1], mess.identifier_key.serverName); User tmpUser = new User(jidSplit[0], jidSplit[1]); tmpUser.SetUser(tmpWhatsUser);