public override void Connect(FrontendManager fm, ServerModel server) { Trace.Call(fm, server); if (fm == null) { throw new ArgumentNullException("fm"); } if (server == null) { throw new ArgumentNullException("server"); } _FrontendManager = fm; Host = "login.oscar.aol.com"; Port = 5190; // TODO: use config for single network chat or once per network manager _NetworkChat = new ProtocolChatModel(NetworkID, NetworkID + " Messenger", this); Session.AddChat(_NetworkChat); Session.SyncChat(_NetworkChat); _OscarSession = new OscarSession(server.Username, server.Password); _OscarSession.ClientCapabilities = Capabilities.Chat | Capabilities.OscarLib; _OscarSession.LoginCompleted += new LoginCompletedHandler(_OnLoginCompleted); _OscarSession.LoginFailed += new LoginFailedHandler(_OnLoginFailed); _OscarSession.LoginStatusUpdate += new LoginStatusUpdateHandler(_OnLoginStatusUpdate); _OscarSession.ErrorMessage += new ErrorMessageHandler(_OnErrorMessage); _OscarSession.WarningMessage += new WarningMessageHandler(_OnWarningMessage); _OscarSession.StatusUpdate += new InformationMessageHandler(_OnStatusUpdate); _OscarSession.ContactListFinished += new ContactListFinishedHandler(_OnContactListFinished); _OscarSession.Messages.MessageReceived += new MessageReceivedHandler(_OnMessageReceived); _OscarSession.Logon(Host, Port); }
private void _OnLoginCompleted(OscarSession sess) { IsConnected = true; string msg = _("Login successful"); Session.AddTextToChat(_NetworkChat, "-!- " + msg); }
public SMSManager(string name, string pw) { sess = new Session(name, pw); //sess.InitializeLogger(Environment.CurrentDirectory); sess.ClientCapabilities = Capabilities.Chat | Capabilities.SendFiles | Capabilities.OscarLib | Capabilities.DirectIM; }
private ulong statsIntervalMins = 1200 * 60; // 1200 Hours is default #endregion Fields #region Constructors internal UsageStatsManager(Session parent) { this.parent = parent; parent.Dispatcher.RegisterSnacFamilyHandler(this, SNAC_USAGESTATS_FAMILY); //statsTimer = new Timer(60000); //statsTimer.Elapsed += new ElapsedEventHandler(statsTimerCallback); //statsTimer.Start(); }
public MainClass(string name, string pw) { sess = new Session(name, pw); sess.InitializeLogger(Environment.CurrentDirectory); sess.ClientCapabilities = Capabilities.SendFiles | Capabilities.OscarLib | Capabilities.AIMtoICQ; sess.SetDefaultIdentification(); sess.LoginCompleted += new LoginCompletedHandler(sess_LoginCompleted); sess.ErrorMessage += new ErrorMessageHandler(sess_ErrorMessage); sess.WarningMessage += new WarningMessageHandler(sess_WarningMessage); sess.StatusUpdate += new InformationMessageHandler(sess_StatusUpdate); sess.LoginFailed += new LoginFailedHandler(sess_LoginFailed); sess.Statuses.UserStatusReceived += new UserStatusReceivedHandler(sess_UserStatusReceived); sess.Statuses.UserInfoReceived += new UserInfoReceivedHandler(sess_UserInfoReceived); sess.MasterGroupItemReceived += new MasterGroupItemReceivedHandler(sess_MasterGroupItemReceived); sess.GroupItemReceived += new GroupItemReceivedHandler(sess_GroupItemReceived); sess.BuddyItemReceived += new BuddyItemReceivedHandler(sess_BuddyItemReceived); sess.ContactListFinished += new ContactListFinishedHandler(sess_ContactListFinished); sess.ChatInvitationReceived += new ChatInvitationReceivedHandler(sess_ChatInvitationReceived); sess.ChatRooms.ChatRoomJoined += new ChatRoomJoinedHandler(sess_ChatRoomCreated); sess.DirectIMRequestReceived += new DirectIMRequestReceivedHandler(sess_DirectIMRequestReceived); sess.DirectIMReceived += new DirectIMReceivedHandler(sess_DirectIMReceived); sess.Messages.TypingNotification += new TypingNotificationEventHandler(sess_TypingNotification); sess.Messages.MessageReceived += new MessageReceivedHandler(sess_MessageReceived); sess.Messages.OfflineMessagesReceived += new OfflineMessagesReceivedEventHandler(ICQ_OfflineMessagesReceived); sess.Messages.MessageDeliveryUpdate += new MessageDeliveryUpdateEventHandler(Messages_MessageDeliveryUpdate); sess.Graphics.AutoSaveLocation = Environment.CurrentDirectory; sess.Graphics.BuddyIconDownloaded += new BuddyIconDownloadedHandler(Graphics_BuddyIconDownloaded); sess.Graphics.BuddyIconUploadCompleted += new BuddyIconUploadCompletedHandler(Graphics_BuddyIconUploadCompleted); sess.Graphics.BuddyIconUploadFailed += new BuddyIconUploadFailedHandler(Graphics_BuddyIconUploadFailed); sess.FileTransferProgress += new FileTransferProgressHandler(sess_FileTransferProgress); sess.FileTransferCompleted += new FileTransferCompletedHandler(sess_FileTransferCompleted); sess.FileTransferRequestReceived += new FileTransferRequestReceivedHandler(sess_FileTransferRequestReceived); sess.FileTransferCancelled += new FileTransferCancelledHandler(sess_FileTransferCancelled); sess.ICQ.ShortUserInfoReceived += new ShortUserInfoReceivedHandler(Icq_ShortUserInfoReceived); sess.ICQ.FullUserInfoReceived += new FullUserInfoReceivedHandler(Icq_FullUserInfoReceived); Login(sess); }
private void sess_FileTransferCompleted(Session sess, Cookie cookie) { filecookie = null; Console.WriteLine("File transfer of {0} complete", cookie.ToString()); }
/// <summary> /// Initializes a new GraphicsManager /// </summary> internal GraphicsManager(Session parent) { this.parent = parent; parent.Dispatcher.RegisterSnacFamilyHandler(this, SNAC_BART_FAMILY); }
private void sess_FileTransferCancelled(Session sess, UserInfo other, Cookie cookie, string reason) { filecookie = null; Console.WriteLine("FileTransferCancelled " + reason + " " + other.ScreenName); }
private void _OnLoginFailed(OscarSession sess, LoginErrorCode errorCode) { string msg = String.Format(_("Login failed: {0}"), errorCode); Session.AddTextToChat(_NetworkChat, "-!- " + msg); }
private void _OnStatusUpdate(OscarSession sess, string message) { Session.AddTextToChat(_NetworkChat, "-!- Status: " + message); }
private void sess_GroupItemReceived(Session sess, SSIGroup group) { //groups[index].group = group; //Console.WriteLine(String.Format("Received Group({0}): {1}", index, group.Name)); //if (group.Children != null) //{ // groups[index].buddies = new SSIBuddy[group.Children.GetLength(0)]; // Console.WriteLine("Children:"); // foreach (ushort childid in group.Children) // { // Console.WriteLine(" {0}", childid); // } //} Console.WriteLine(String.Format("Received Group({0}): {1}", group.ID, group.Name)); }
private void sess_LoginFailed(Session sess, LoginErrorCode reason) { Console.WriteLine(reason); }
private void sess_StatusUpdate(Session sess, string message) { Console.WriteLine("Status: " + message); }
/// <summary> /// Initializes a new ServiceManager /// </summary> internal ServiceManager(Session parent) { this.parent = parent; parent.Dispatcher.RegisterSnacFamilyHandler(this, SNAC_BOS_FAMILY); this.AuthCookie = (new Random()).Next(int.MinValue, int.MaxValue); }
public void Login(Session sess) { //sess.Logon("login.oscar.aol.com", 5190); //sess.Logon(); sess.Logon("login.icq.com", 5190, false); //sess.Logon("slogin.icq.com", 443, true); }
private void _OnContactListFinished(OscarSession sess, DateTime time) { Session.AddTextToChat(_NetworkChat, "-!- Contact list finished"); _OscarSession.ActivateBuddyList(); }
private void _OnWarningMessage(OscarSession sess, ServerErrorCode errorCode) { string msg = String.Format(_("Connection Warning: {0}"), errorCode); Session.AddTextToChat(_NetworkChat, "-!- " + msg); }
private void sess_FileTransferProgress(Session sess, Cookie cookie, uint BytesTransfered, uint BytesTotal) { Console.WriteLine("Transfered {0} of {1} of {2}", BytesTransfered, BytesTotal, cookie.ToString()); }
/// <summary> /// Initializes a new AuthorizationManager /// </summary> internal AuthorizationManager(Session parent) { this.parent = parent; parent.Dispatcher.RegisterSnacFamilyHandler(this, SNAC_AUTH_FAMILY); }
private void sess_FileTransferRequestReceived(Session sess, UserInfo sender, string IP, string filename, uint filesize, string message, Cookie key) { filecookie = key; Console.WriteLine("Auto-accepting " + filename); sess.AcceptFileTransfer(key, "C:\\recv_" + filename); }
private void sess_LoginCompleted(Session sess) { Console.WriteLine("Login complete"); }
private void _OnLoginStatusUpdate(OscarSession sess, string messages, double percent) { Session.AddTextToChat(_NetworkChat, "-!- Login: " + messages); }
private void sess_MasterGroupItemReceived(Session sess, int k) { for (int i = 0; i < k; ++i) groups.Add(new ContactListGroup()); Console.WriteLine(String.Format("Expecting {0} groups", k)); }
private void sess_BuddyItemReceived(Session sess, SSIBuddy buddy) { //foreach (ContactListGroup clg in groups) //{ // if ((clg.group != null) && (clg.group.ID == buddy.GroupID)) // { // for (int i = 0; i < clg.group.Children.GetLength(0); ++i) // { // if (clg.group.Children[i] == buddy.ID) // { // clg.buddies[i] = buddy; // } // } // } //} Console.WriteLine(String.Format("Received Buddy({0}): {1}({2}) GroupId:{3}", buddy.ID, buddy.Name, buddy.DisplayName,buddy.GroupID)); }
private void sess_WarningMessage(Session sess, ServerErrorCode error) { Console.WriteLine("Warning: " + error); }
private void sess_ChatInvitationReceived(Session sess, UserInfo sender, string roomname, string message, Encoding encoding, string language, Cookie key) { Console.WriteLine("Received chat invite from " + sender.ScreenName + " to " + roomname + ": " + message); Console.WriteLine("Auto-accepting"); sess.ChatRooms.JoinChatRoom(key); }
public override void Connect(FrontendManager fm, string host, int port, string username, string password) { Trace.Call(fm, host, port, username, password); _FrontendManager = fm; Host = "login.oscar.aol.com"; Port = 5190; // TODO: use config for single network chat or once per network manager _NetworkChat = new ProtocolChatModel(NetworkID, NetworkID + " Messenger", this); Session.AddChat(_NetworkChat); Session.SyncChat(_NetworkChat); _OscarSession = new OscarSession(username, password); _OscarSession.ClientCapabilities = Capabilities.Chat | Capabilities.OscarLib; _OscarSession.LoginCompleted += new LoginCompletedHandler(_OnLoginCompleted); _OscarSession.LoginFailed += new LoginFailedHandler(_OnLoginFailed); _OscarSession.LoginStatusUpdate += new LoginStatusUpdateHandler(_OnLoginStatusUpdate); _OscarSession.ErrorMessage += new ErrorMessageHandler(_OnErrorMessage); _OscarSession.WarningMessage += new WarningMessageHandler(_OnWarningMessage); _OscarSession.StatusUpdate += new InformationMessageHandler(_OnStatusUpdate); _OscarSession.ContactListFinished += new ContactListFinishedHandler(_OnContactListFinished); _OscarSession.Messages.MessageReceived += new MessageReceivedHandler(_OnMessageReceived); _OscarSession.Logon(Host, Port); }
private void sess_ContactListFinished(Session sess, DateTime dt) { Console.WriteLine(); Console.WriteLine("Contact List Finished"); //BuddyListDump(); sess.ActivateBuddyList(); }
private void sess_DirectIMReceived(Session sess, DirectIM message) { Console.WriteLine("DirectIM Message from {1}: {0}", message.Message, message.ScreenName); sess.Messages.SendMessage(message.ScreenName, "Your momma!", OutgoingMessageFlags.None); }
private void sess_DirectIMRequestReceived(Session sess, UserInfo sender, string message, Cookie key) { Console.WriteLine("Auto-accepting DIM invite from {0} ({1})", sender.ScreenName, message); sess.AcceptDirectIMSession(key); }
private void sess_ErrorMessage(Session sess, ServerErrorCode error) { Console.WriteLine("Error: " + error); }