package Ġcom . lo f tech s . sample . receiver Ċ Ċ import Ġcom . lo f tech s . sample . common . event .* Ċ import Ġcom . lo f tech s . sample . extensions . log Debug Ċ import Ġcom . lo f tech s . sample . extensions . remove Ċ import Ġcom . lo f tech s . sample . model . Profile Info Manager Ċ import Ġcom . lo f tech s . sample . utils . File Util Ċ import Ġcom . lo f tech s . sdk . im . L TIM Manager Listener Ċ import Ġcom . lo f tech s . sdk . im . channels .* Ċ import Ġcom . lo f tech s . sdk . im . message .* Ċ import Ġcom . lo f tech s . sdk . im . users . LT Modify UserProfile Response Ċ import Ġcom . lo f tech s . sdk . im . users . LT Set UserProfile Response Ċ import Ġcom . lo f tech s . sdk . listener . LT Error Info Ċ import Ġorg . green robot . event bus . EventBus Ċ Ċ class ĠIM Receiver Ġ: ĠL TIM Manager Listener () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġon Connected ( userID : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Connected ĠuserID : Ġ$ userID ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Disconnected ( userID : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Disconnected ĠuserID : Ġ$ userID ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Join Channel ( to UserID : ĠString , Ġjoin Channel Response : ĠLT Join Channel Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Answer Invitation Ġresponse : Ġ$ join Channel Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Event ( to UserID , Ġjoin Channel Response . ch ID )) ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Incoming Message Event ( to UserID , Ġjoin Channel Response . ch ID , Ġjoin Channel Response )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Create Channel ( to UserID : ĠString , Ġcreate Channel Response : ĠLT Create Channel Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Create Channel Ġresponse : Ġ$ create Channel Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Event ( to UserID , Ġcreate Channel Response . ch ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Dismiss Channel ( to UserID : ĠString , Ġdismiss Channel Response : ĠLT Dismiss Channel Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Dismiss Channel Ġresponse : Ġ$ dismiss Channel Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Close Event ( to UserID , Ġdismiss Channel Response . ch ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Invite Member ( to UserID : ĠString , Ġinvite Member Response : ĠLT Invite Member Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Invite Member Ġresponse : Ġ$ invite Member Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Event ( to UserID , Ġinvite Member Response . ch ID )) ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Member Changed Event ( to UserID , Ġinvite Member Response . ch ID )) ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Incoming Message Event ( to UserID , Ġinvite Member Response . ch ID , Ġinvite Member Response )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Kick Member ( to UserID : ĠString , Ġkick Member Response : ĠL TK ick Member Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Kick Member Ġresponse : Ġ$ kick Member Response ") ĊĠĠĠĠĠĠĠ Ġval Ġmembers Ġ= Ġkick Member Response . members ĊĠĠĠĠĠĠĠ Ġfor Ġ( member Ġin Ġmembers ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( member . userID Ġ== Ġto UserID ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠFile Util . get Profile File ("${ kick Member Response . ch ID }. jpg ", Ġfalse ). remove () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProfile Info Manager . clean Profile Info ByID ( kick Member Response . ch ID ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Close Event ( to UserID , Ġkick Member Response . ch ID )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Member Changed Event ( to UserID , Ġkick Member Response . ch ID )) ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Incoming Message Event ( to UserID , Ġkick Member Response . ch ID , Ġkick Member Response )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Leave Channel ( to UserID : ĠString , Ġleave Channel Response : ĠLT Leave Channel Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Leave Channel Ġresponse : Ġ$ leave Channel Response ") ĊĠĠĠĠĠĠĠ Ġval Ġmembers Ġ= Ġleave Channel Response . members ĊĠĠĠĠĠĠĠ Ġfor Ġ( member Ġin Ġmembers ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( member . userID Ġ== Ġto UserID ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠFile Util . get Profile File ("${ leave Channel Response . ch ID }. jpg ", Ġfalse ). remove () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠProfile Info Manager . clean Profile Info ByID ( leave Channel Response . ch ID ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Close Event ( to UserID , Ġleave Channel Response . ch ID )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Member Changed Event ( to UserID , Ġleave Channel Response . ch ID )) ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Incoming Message Event ( to UserID , Ġleave Channel Response . ch ID , Ġleave Channel Response )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Channel Preference ( to UserID : ĠString , Ġresponse : ĠLT Channel Preference Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Set Channel Preference Ġresponse : Ġ$ response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Event ( to UserID , Ġresponse . ch ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Channel Profile ( to UserID : ĠString , Ġresponse : ĠLT Channel Profile Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Set Channel Profile Ġresponse : Ġ$ response ") ĊĠĠĠĠĠĠĠ ĠProfile Info Manager . clean Profile Info ByID ( response . ch ID ) ĊĠĠĠĠĠĠĠ ĠFile Util . get Profile File ("${ response . ch ID }. jpg ", Ġfalse ). remove () ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Incoming Message Event ( to UserID , Ġresponse . ch ID , Ġresponse )) ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Event ( to UserID , Ġresponse . ch ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Channel UserProfile ( to UserID : ĠString , Ġset Channel Profile Response : ĠLT Channel UserProfile Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Set Channel UserProfile Ġresponse : Ġ$ set Channel Profile Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Member Role ( to UserID : ĠString , Ġmember Role Response : ĠLT Member Role Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Set Member Role Ġresponse : Ġ$ member Role Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Incoming Message Event ( to UserID , Ġmember Role Response . ch ID , Ġmember Role Response )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Set Channel Member Profile ( to UserID : ĠString , Ġset Channel Member Profile Response : ĠLT Set Channel Member Profile Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Set Channel Member Profile Ġresponse : Ġ$ set Channel Member Profile Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Create Public News Channel ( to UserID : ĠString , Ġcreate Public News Channel Response : ĠLT Create News Channel Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Create Public News Channel Ġresponse : Ġ$ create Public News Channel Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Create Cor p News Channel ( to UserID : ĠString , Ġcreate Cor p News Channel Response : ĠLT Create News Channel Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Create Cor p News Channel Ġresponse : Ġ$ create Cor p News Channel Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Message ( to UserID : ĠString , Ġmessage Response : ĠLT Message Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Message Ġresponse : Ġ$ message Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming SendMessage ( to UserID : ĠString , ĠsendMessage Response : ĠLT SendMessage Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming SendMessage Ġresponse : Ġ$ sendMessage Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Incoming Message Event ( to UserID , ĠsendMessage Response . ch ID , ĠsendMessage Response )) ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Chat Event ( to UserID , ĠsendMessage Response . ch ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Scheduled Message ( to UserID : ĠString , Ġscheduled Message Response : ĠLTS chedule d Message Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Scheduled Message Ġresponse : Ġ$ scheduled Message Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Scheduled Vote Response ( to UserID : ĠString , Ġscheduled Vote Response : ĠLTS chedule d Vote Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Scheduled Vote Response Ġresponse : Ġ$ scheduled Vote Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Scheduled In Due Time Message ( to UserID : ĠString , Ġscheduled In Due Time Message Response : ĠLTS chedule d In Due Time Message Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Scheduled In Due Time Message Ġresponse : Ġ$ scheduled In Due Time Message Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Mark Read ( to UserID : ĠString , Ġmark Read Response : ĠLT Mark Read Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Mark Read Ġresponse : Ġ$ mark Read Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Mark Read Event ( to UserID , Ġmark Read Response . ch ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Mark Read News ( to UserID : ĠString , Ġmark Read News Response : ĠLT Mark Read News Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Mark Read News Ġresponse : Ġ$ mark Read News Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Create Vote Message ( to UserID : ĠString , Ġcreate Vote Response : ĠLT Create Vote Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Create Vote Message Ġresponse : Ġ$ create Vote Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Cast Vote Message ( to UserID : ĠString , Ġcast Vote Response : ĠL TC ast Vote Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Cast Vote Message Ġresponse : Ġ$ cast Vote Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Delete All Messages ( to UserID : ĠString , Ġdelete All Messages Response : ĠLT Delete All Messages Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Delete All Messages Ġresponse : Ġ$ delete All Messages Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Delete Channel Message ( to UserID : ĠString , Ġdelete Channel Message Response : ĠLT Delete Channel Message Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Delete Channel Message Ġresponse : Ġ$ delete Channel Message Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Delete Messages ( to UserID : ĠString , Ġdelete Messages Response : ĠLT Delete Messages Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Delete Messages Ġresponse : Ġ$ delete Messages Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Update Message Event ( to UserID , Ġdelete Messages Response . ch ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Re call Message ( to UserID : ĠString , Ġrecall Messages Response : ĠLT Re call Messages Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Re call Message Ġresponse : Ġ$ recall Messages Response ") ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Update Message Event ( to UserID , Ġrecall Messages Response . ch ID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming News Message ( to UserID : ĠString , Ġmessage Response : ĠLT News Message Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming News Message Ġresponse : Ġ$ message Response ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Set UserProfile ( to UserID : ĠString , Ġset UserProfile Response : ĠLT Set UserProfile Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Set UserProfile Ġresponse : Ġ$ set UserProfile Response ") ĊĠĠĠĠĠĠĠ ĠProfile Info Manager . clean Profile Info ByID ( to UserID ) ĊĠĠĠĠĠĠĠ ĠFile Util . get Profile File ("${ to UserID }. jpg ", Ġfalse ). remove () ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( UserProfile ChangeEvent ( to UserID , Ġto UserID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Incoming Modify UserProfile ( to UserID : ĠString , Ġmodify UserProfile Response : ĠLT Modify UserProfile Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" on Incoming Modify UserProfile Ġresponse : Ġ$ modify UserProfile Response ") ĊĠĠĠĠĠĠĠ ĠProfile Info Manager . clean Profile Info ByID ( modify UserProfile Response . sender ID ) ĊĠĠĠĠĠĠĠ ĠFile Util . get Profile File ("${ modify UserProfile Response . sender ID }. jpg ", Ġfalse ). remove () ĊĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( UserProfile ChangeEvent ( to UserID , Ġto UserID )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonError ( error Info : ĠLT Error Info ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlog Debug (" onError Ġe : Ġ$ error Info ") ĊĠĠĠ Ġ} Ċ }