Created
December 6, 2015 08:12
-
-
Save beomkm/208743f511bb6a5188b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function choo() { | |
return oChatRoom.valueOf()._oDoc._aMemberList[Math.floor(Math.random()*oChatRoom.valueOf()._oDoc._aMemberList.length)].nickname | |
} | |
oChatRoom._processNotiItem = function(h, f, b) { | |
if (g_sUserId !== f) { | |
return; | |
} | |
var c = b.cafeId; | |
var j = b.roomId; | |
if (c !== this._oDoc.getCafeId() || j !== this._oDoc.getRoomId()) { | |
return; | |
} | |
switch (h) { | |
case chat.NotiType.Msg: | |
var g = b.msgSn; | |
if(b.msg.search("티바") != -1) oChatRoom._sendMsg(b.senderNickname + "님 죄송합니다. 대신" + choo() +"님과 대화를 하세요.",0); | |
if (g <= this._oDoc.getLastMsgSn()) { | |
return; | |
} | |
var d = g - this._oDoc.getLastMsgSn(); | |
if (d !== 1) { | |
this._syncMsg(this._oDoc.getLastMsgSn()); | |
return; | |
} | |
this._oDoc.setLastMsgSn(g); | |
if (this._oDynamicNodeRenderer.isUserScroll()) { | |
var e = oChatRoomMessage.createAlarmMessage(b.msgType, b.msg); | |
$Element("newMsgContainer").show(); | |
$Element("newMsgBody").html(oUtil.generateUserLabel(b.senderId, b.senderNickname) + " : " + e); | |
this._initTransitionNewMsgComponent(); | |
this._oTransitionNewMsg.abort().start(4000, $("newMsgContainer"), { | |
"@opacity": jindo.Effect.easeOut(1, 1) | |
}).start(2000, $("newMsgContainer"), { | |
"@opacity": jindo.Effect.easeOut(1, 0) | |
}); | |
} | |
var a = oChatRoomMessage.createMsgHtmlFromNoti(h, b, this._oDoc); | |
return a; | |
case chat.NotiType.ClosedOpenroom: | |
this._disableRoom(); | |
var a = this._oTemplate.closedRoom.process(); | |
return a; | |
case chat.NotiType.Invited: | |
case chat.NotiType.ChangeRoomName: | |
case chat.NotiType.DeleteRoom: | |
case chat.NotiType.JoinRoom: | |
default: | |
this._syncRoom(); | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment