VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "General"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Private WithEvents Msg As Messenger
Attribute Msg.VB_VarHelpID = -1

Public Sub Init()
Set Msg = StartCode.Msg
End Sub

Private Sub Msg_OnAppShutdown()
MainForm.Finish
End Sub

Private Sub Msg_OnContactAddedToGroup(ByVal hr As Long, ByVal pMGroup As Object, ByVal pMContact As Object)
BuddyList.AddContactGroup pMContact
End Sub

Private Sub Msg_OnContactBlockChange(ByVal hr As Long, ByVal pContact As Object, ByVal pBoolBlock As Boolean)
If Online Then BuddyList.ImageChange pContact
End Sub

Private Sub Msg_OnContactFriendlyNameChange(ByVal hr As Long, ByVal pMContact As Object, ByVal bstrPrevFriendlyName As String)
Dim c As IMessengerContact
Set c = pMContact
If c.IsSelf Then Exit Sub

BuddyList.NameChange c
MsgAlert.NameChange c, bstrPrevFriendlyName
End Sub

Private Sub Msg_OnContactListAdd(ByVal hr As Long, ByVal pMContact As Object)
BuddyList.StructureChange
End Sub

Private Sub Msg_OnContactListRemove(ByVal hr As Long, ByVal pMContact As Object)
If Online Then BuddyList.StructureChange
End Sub

Private Sub Msg_OnContactRemovedFromGroup(ByVal hr As Long, ByVal pMGroup As Object, ByVal pMContact As Object)
If Online Then BuddyList.StructureChange
End Sub

Private Sub Msg_OnContactStatusChange(ByVal pMContact As Object, ByVal mStatus As MessengerAPI.MISTATUS)
If StatusFlux Then Exit Sub

Dim pi As PersonInfo, c As IMessengerContact
Set c = pMContact
Set pi = GetPersonInfo(c.SigninName)
If pi.LastStatus = c.Status Then Exit Sub

Dim LastStatus As MISTATUS
LastStatus = pi.LastStatus
pi.LastStatus = c.Status 'Note: Also set by BuddyList

BuddyList.ImageChange pMContact
MsgAlert.StatusChange pMContact, LastStatus
End Sub

Private Sub Msg_OnGroupAdded(ByVal hr As Long, ByVal pMGroup As Object)
BuddyList.StructureChange
End Sub

Private Sub Msg_OnGroupNameChanged(ByVal hr As Long, ByVal pMGroup As Object)
BuddyList.StructureChange
End Sub

Private Sub Msg_OnGroupRemoved(ByVal hr As Long, ByVal pMGroup As Object)
If Online Then BuddyList.StructureChange
End Sub

Private Sub Msg_OnIMWindowContactAdded(ByVal pContact As Object, ByVal pIMWindow As Object)
'Stop 'Conversation
End Sub

Private Sub Msg_OnIMWindowCreated(ByVal pIMWindow As Object)
Dim i As IMessengerConversationWnd
Set i = pIMWindow

End Sub

Private Sub Msg_OnMyFriendlyNameChange(ByVal hr As Long, ByVal bstrPrevFriendlyName As String)
BuddyList.MyNameChange
MainForm.MyNameChange
MsgAlert.MyNameChange bstrPrevFriendlyName
End Sub

Private Sub Msg_OnMyStatusChange(ByVal hr As Long, ByVal mMyStatus As MessengerAPI.MISTATUS)
CurrentStatus.Event_MyStatusChange hr, mMyStatus
End Sub

Private Sub Msg_OnSignin(ByVal hr As Long)
CurrentStatus.Event_Signin hr
End Sub

Private Sub Msg_OnSignout()
CurrentStatus.Event_Signout
End Sub

Private Sub Msg_OnUnreadEmailChange(ByVal mFolder As MessengerAPI.MUAFOLDER, ByVal cUnreadEmail As Long, pBoolfEnableDefault As Boolean)
MainForm.EmailChange cUnreadEmail
MsgAlert.EmailChange cUnreadEmail
TrayCode.EmailChange cUnreadEmail
End Sub
