var messenger_controllers=angular.module("watuu.messenger",[]);messenger_controllers.run(["$rootScope",function(a){a.share_in_chat=0;a.tmp_msgs_arr=[];a.setTmpMsgsArr=function(b){a.tmp_msgs_arr=b};a.setShareOnChat=function(b){a.share_in_chat=b};a.current_pending_msg=""}]); messenger_controllers.controller("ConversationsController",["$scope","messengerService","$location","userService","$rootScope","globalconfig",function(a,b,g,c,h,e){null==b.connection?b.connectToXmpp(c.getXmppUser(),c.getPlainPass()):b.checkConnectionStatus();angular.element(document).ready(function(){var f=c.getXmppUser()+e.domain_name;b.listConversations(f,a)});a.setJabberIdAndLocalNameAndRemoteNameAndImgName=function(a,k,d){b.jabber_id=a;b.local_name="undefined"!=typeof c.first_name&&""!=c.first_name? c.first_name:c.username;b.remote_name=k;b.img_name="undefined"!=typeof d&&d?d:e.user_pic_placeholder}}]); messenger_controllers.controller("ChatController",["$scope","messengerService","$location","userService","$rootScope","playerService","globalconfig",function(a,b,g,c,h,e,f){null==b.connection?b.connectToXmpp(c.getXmppUser(),c.getPlainPass()):b.checkConnectionStatus();angular.element(document).on("click",".jabber_id",function(){var a=$(this).attr("id"),c=$(this).attr("name");b.jabber_id=a;b.contact_name=c});angular.element("#chat-input").on("keypress",function(a){var d=b.jabber_id;13===a.which?(a.preventDefault(), a=$(this).val(),d=$msg({to:d,type:"chat"}).c("body").t(a).up().c("active",{xmlns:"http://jabber.org/protocol/chatstates"}),b.connection.send(d),b.storeChatMessage({body:a,fromJID:c.getXmppUser()+f.domain_name,toJID:b.jabber_id,sentDate:"0"}),$("#messages_log").append("<li class='my-message'><span class='bubble my-message-body'> "+a+"</span></li>"),$("html, body").animate({scrollTop:$("#chat-input").offset().top},1E3),$(this).val(""),$("#composing").attr("value","false")):"false"===$("#composing").attr("value")&& (d=$msg({to:d,type:"chat"}).c("composing",{xmlns:"http://jabber.org/protocol/chatstates"}),b.connection.send(d),$("#composing").attr("value","true"))});angular.element(document).off("click",".btn-play").on("click",".btn-play",function(a){a=$(this).attr("id");e.playPauseInChat(a)});a.contact_name="";a.printContactName=function(){a.contact_name=b.remote_name};a.printContactName();b.getConversationMessages(c.getXmppUser()+f.domain_name)}]);