Commit a64b4d31 by Lee Munkyeong

マージリクエストのコメント対応

parent 8c77c525
......@@ -7,7 +7,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class MShopMember extends SQLiteTableScript {
public MShopMember(){
public MShopMember() {
};
@Override
......
......@@ -7,7 +7,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class TArchive extends SQLiteTableScript {
public TArchive(){
public TArchive() {
};
@Override
......
......@@ -7,7 +7,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class TChatMessage extends SQLiteTableScript {
public TChatMessage(){
public TChatMessage() {
};
@Override
......
......@@ -7,7 +7,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class TChatRoom extends SQLiteTableScript {
public TChatRoom(){
public TChatRoom() {
};
@Override
......
......@@ -7,7 +7,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class TCollaboration extends SQLiteTableScript {
public TCollaboration(){
public TCollaboration() {
};
@Override
......
......@@ -7,7 +7,7 @@ import jp.agentec.abook.abv.bl.common.db.SQLiteDatabase;
public class TCollaborationDetail extends SQLiteTableScript {
public TCollaborationDetail(){
public TCollaborationDetail() {
};
@Override
......
......@@ -69,20 +69,20 @@ public class CommunicationLogic extends AbstractLogic {
JSONArray resultJsonArray = new JSONArray();
for (ChatRoomDto chatRoomDto : chatRoomList) {
Map<String, Object> chatRoomMap = new HashMap<String, Object>();
chatRoomMap.put("chatRoomId",chatRoomDto.chatRoomId);
chatRoomMap.put("chatRoomName",chatRoomDto.chatRoomName);
chatRoomMap.put("type",chatRoomDto.type);
chatRoomMap.put("favoriteRegisterDate",chatRoomDto.favoriteRegisterDate);
chatRoomMap.put("unreadCount",chatRoomDto.unreadCount);
chatRoomMap.put("message",chatRoomDto.message);
chatRoomMap.put("messageType",chatRoomDto.messageType);
chatRoomMap.put("insertDate",chatRoomDto.insertDate);
chatRoomMap.put("userCount",chatRoomDto.userCount);
JSONObject jsonObject =new JSONObject(chatRoomMap);
chatRoomMap.put("chatRoomId", chatRoomDto.chatRoomId);
chatRoomMap.put("chatRoomName", chatRoomDto.chatRoomName);
chatRoomMap.put("type", chatRoomDto.type);
chatRoomMap.put("favoriteRegisterDate", chatRoomDto.favoriteRegisterDate);
chatRoomMap.put("unreadCount", chatRoomDto.unreadCount);
chatRoomMap.put("message", chatRoomDto.message);
chatRoomMap.put("messageType", chatRoomDto.messageType);
chatRoomMap.put("insertDate", chatRoomDto.insertDate);
chatRoomMap.put("userCount", chatRoomDto.userCount);
JSONObject jsonObject = new JSONObject(chatRoomMap);
resultJsonArray.put(jsonObject);
}
String testStr1 = resultJsonArray.toString();
return testStr1;
String roomListToStr = resultJsonArray.toString();
return roomListToStr;
}
public void insertChatRoomList(List<ChatRoomDto> roomList) {
......
......@@ -587,9 +587,9 @@ public class DateTimeUtil {
public static String millToDateString(long mills) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
Date timeInDate = new Date(mills);
String timeInFormat = sdf.format(timeInDate);
String timeInFormat = dateFormat.format(timeInDate);
return timeInFormat;
}
......
......@@ -440,7 +440,7 @@
<script src="./js/chat-websocket.js"></script>
</body>
<script>
jQuery('#homeButton').on('click', function(){
jQuery('#homeButton').on('click', function() {
if (CHAT_UTIL.isIOS()) {
webkit.messageHandlers.goHome.postMessage({});
......
......@@ -44,7 +44,7 @@ $(window).on('resize', function(){
// New Room
// チャットルーム生成ボタン処理
$('#createChatRoom').on('click', function(){
$('#createChatRoom').on('click', function() {
//loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
......@@ -55,20 +55,20 @@ $('#createChatRoom').on('click', function(){
// Room Delete
// チャットルーム削除ボタン処理
$('#roomDeleteButton').on('click', function(e){
$('#roomDeleteButton').on('click', function(e) {
if ($('.deleteBox').is(':visible')) {
// チャットルーム削除アイコンが表示されている時、ブラインド処理を行う
$('.deleteBox').finish().show().fadeTo('slow',0,function(){
$('.deleteBox').finish().show().fadeTo('slow', 0, function() {
$(this).hide();
});
// チャットリストについてクリックイベントを与える
$('.chat_list').off('click');
$('.chat_list:not(.active_chat)').on('click', function(e){
$('.chat_list:not(.active_chat)').on('click', function(e) {
//loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
let roomId = $(this).data('roomId');
let roomName = $(this).data('roomname');
socket.emit('joinRoom', roomId, roomName, function (){
socket.emit('joinRoom', roomId, roomName, function() {
$('#messages').html('');
$('.titleRoomName').text(roomName).data('roomName', roomName);
$('#pills-chat-tab').tab('show');
......@@ -449,7 +449,7 @@ $('a[data-toggle="pill"]').on('show.bs.tab', function (e) {
});
// Tab Close/Hidden Event
$('a[data-toggle="pill"]').on('hide.bs.tab', function (e){
$('a[data-toggle="pill"]').on('hide.bs.tab', function(e) {
var target = $(e.target).attr("href"); // e.target : activated tab
switch(target) {
case '#pills-chat':
......
......@@ -31,7 +31,7 @@ function connectSocket(isOnline) {
* Socket Connect/Disconnectc
* --------------------------------------------------- */
function setSocketAction () {
socket.on('connect', function (){
socket.on('connect', function() {
// socketが接続されたらチャット画面で画面を更新する
$('.overlay').removeClass('active undismissable');
// loadingIndicatorを表示
......@@ -171,7 +171,7 @@ function setSocketAction () {
// New Message
// #36170
socket.on('newMessage', function (message, roomId, roomName){
socket.on('newMessage', function (message, roomId, roomName) {
let template = $('#message-template').html();
if (message.id === socket.id) {
// ユーザーが送信したメッセージの場合、自分のメッセージ様式を適用して表示する
......@@ -224,11 +224,11 @@ function setSocketAction () {
}
let messageTime = CHAT_UTIL.formatDate(message.time.time);
if(users != undefined) {
if (users != undefined) {
let user = users.find((user) => user.loginId == message.loginId)
// userProfilePathが使えるpathかをcheckして使えないpathの場合、default画像の経路に変更
if(user) {
if (user) {
message.profileImagePath = CHAT.getProfileImgUrl(user.profileImagePath)
} else {
message.profileImagePath = CHAT.getProfileImgUrl("")
......@@ -286,7 +286,7 @@ function setSocketAction () {
$('#users').data(users);
} else {
const data = $('#users').data();
if(data && Object.keys(data).length > 0){
if (data && Object.keys(data).length > 0){
users = Object.keys(data).map(function(key) {
return data[key];
});
......@@ -307,7 +307,7 @@ function setSocketAction () {
}));
// ユーザーリストを入れる
users.forEach(function (user){
users.forEach(function(user) {
let li = $('<li/>');
let a = $('<a/>').text(user);
if (onlineUsers.includes(user)) {
......@@ -328,13 +328,13 @@ function setSocketAction () {
$('#group_list').append('<center class="text-secondary">'+ getLocalizedString(everyoneIsHere) +'</center>');
}
// グループ名と人数を表記する。
groups.forEach( function(group) {
groups.forEach(function(group) {
let html = Mustache.render(template, {
name: group.groupName,
info: group.memberCnt + getLocalizedString("people")
});
// グループをクリックすると、該当グループのユーザーリストを読み込むようにイベントを与える
let obj = $(jQuery.parseHTML(html)).on('click',function(){
let obj = $(jQuery.parseHTML(html)).on('click', function() {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
socket.emit('getUserListInGroup', group.groupId, isInvite);
......@@ -344,7 +344,7 @@ function setSocketAction () {
});
// Rotate
if(CHAT_UI.isLandscapeMode()) {
if (CHAT_UI.isLandscapeMode()) {
$(".group_list").addClass("col-6").removeClass("col-12");
}
......@@ -443,7 +443,7 @@ function setSocketAction () {
$('.userCheckBox').show();
// Rotate
if(CHAT_UI.isLandscapeMode()) {
if (CHAT_UI.isLandscapeMode()) {
$(".user_list").addClass("col-6").removeClass("col-12");
$(".squareBoxContent span").addClass("landscape_span");
}
......@@ -475,7 +475,7 @@ function setSocketAction () {
// #36174
// #36215
if(message.includes("SC_FORBIDDEN"))
if (message.includes("SC_FORBIDDEN"))
{
alert('SC_FORBIDDEN');
return;
......@@ -497,7 +497,7 @@ function setSocketAction () {
});
CHAT_UI.dismissLoadingIndicator();
if(message == "Room not found"){
if (message == "Room not found"){
CHAT.saveRoomInfo();
}
});
......@@ -505,18 +505,18 @@ function setSocketAction () {
// server's request : user info (retry join)
socket.on("retryJoinProcess", () => {
var ua = window.navigator.userAgent.toLowerCase();
//if((ua.indexOf('iphone') > 0 || ua.indexOf('ipad') > 0) && ua.indexOf("safari") == -1) {
//if ((ua.indexOf('iphone') > 0 || ua.indexOf('ipad') > 0) && ua.indexOf("safari") == -1) {
if (CHAT_UTIL.isIOS()) {
// iosでの場合
webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
// } else if(ua.indexOf('android') > 0 && ua.indexOf('linux') == -1){
// } else if (ua.indexOf('android') > 0 && ua.indexOf('linux') == -1){
} else if (CHAT_UTIL.isAndroid()) {
// androidでの場合
android.getLoginParameter();
} else {
CHAT_UI.htmlElementTextInitialize("ko")
// webでのsocket connect
socket.emit('join', params, function (err) {
socket.emit('join', params, function(err) {
if (err) {
// #36174
$("#customAlertTitle").text(err);
......@@ -529,7 +529,7 @@ function setSocketAction () {
.on('click', '#customAlertOk', function(e) {
});
} else {
if(params.roomName != undefined) {
if (params.roomName != undefined) {
$('.titleRoomName').text(params.roomName).data('roomName', params.roomName);
} else {
let roomListTitle = getLocalizedString("roomListTitle")
......
......@@ -25,7 +25,7 @@ CHAT.saveRoomInfo = function(roomId, roomName) {
// #36170 画像パスが存在しない場合はデフォルトの画像を返す
// 存在する場合はプロフィール画像取得用APIのURLを生成して返す
CHAT.getProfileImgUrl = function(path) {
if(path == undefined || path == "") {
if (path == undefined || path == "") {
return ASSET_PATH + 'images/user-profile.png';
} else {
var userInfo = path.split("/").reverse();
......@@ -59,16 +59,16 @@ CHAT.createVideoThumbnailAndUpload = function(sourceImage, callback) {
canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);
fetch(canvas.toDataURL("image/jpeg"))
.then(function(res){
.then(function(res) {
return res.arrayBuffer();
})
.then(function(buf){
.then(function(buf) {
// 回転された画像をFormDataに保存
const newFile = new File([buf], sourceImage.name, {type:"image/jpeg"});
callback(newFile, true);
// ajax End
}).catch((error) => { // fetch Error catch Block
if(error) {
if (error) {
console.log(error)
}
});
......@@ -95,7 +95,7 @@ CHAT.uploadImage = function(formData) {
data: formData,
contentType: false,
processData: false
}).done(function( res ){
}).done(function(res) {
// 8
var imgPath = CMS_SERVER_URL + '/file/getImage?fileName=' + res.fileName + '&roomId=' + CHAT.globalLoginParameter.roomId;
var imageName = res.fileName
......@@ -105,7 +105,7 @@ CHAT.uploadImage = function(formData) {
// 画像の処理
if (res.fileType == "jpeg" || res.fileType == "jpg" || res.fileType == "png") {
if(res.thumbnailPath && res.thumbnailPath.length > 0) {
if (res.thumbnailPath && res.thumbnailPath.length > 0) {
imgPath = CMS_SERVER_URL + '/file/getImage?fileName=' + res.thumbImageFileName + '&roomId=' + CHAT.globalLoginParameter.roomId;
imageName = res.thumbImageFileName;
}
......@@ -166,7 +166,7 @@ CHAT.uploadImage = function(formData) {
CHAT.createThumbnailAndUpload = function(sourceImage, callback) {
const fileReader = new FileReader();
const img = new Image();
fileReader.onloadend = function(){
fileReader.onloadend = function() {
img.src = fileReader.result
}
......@@ -175,13 +175,13 @@ CHAT.createThumbnailAndUpload = function(sourceImage, callback) {
var rate
var width = img.width
var height = img.height
if((img.width <= 500) && (img.height <= 500))
if ((img.width <= 500) && (img.height <= 500))
{
callback(undefined, false)
return
}
if(img.width > img.height)
if (img.width > img.height)
{
rate = 500/img.width
} else {
......@@ -196,16 +196,16 @@ CHAT.createThumbnailAndUpload = function(sourceImage, callback) {
// ctx.drawImage(img, 0, 0, width, height);
fetch(elem.toDataURL("image/jpeg"))
.then(function(res){
.then(function(res) {
return res.arrayBuffer();
})
.then(function(buf){
.then(function(buf) {
const newFile = new File([buf], sourceImage.name, {type:"image/jpeg"});
callback(newFile, true)
}).catch((error) => { // fetch Error catch Block
if(error) {
if (error) {
console.log(error)
}
});
......@@ -225,13 +225,13 @@ getLoginParameter = function(sid, loginId, shopName, roomId = undefined, roomNam
CHAT.globalLoginParameter = loginParam;
if(!languageCode) {
if (!languageCode) {
languageCode = "en"
}
CHAT_UI.htmlElementTextInitialize(languageCode)
if (IS_ONLINE == 'true') {
socket.emit('join', loginParam, function (err) {
socket.emit('join', loginParam, function(err) {
if (err) {
// #36174
$("#customAlertTitle").text(err);
......
......@@ -75,7 +75,7 @@ function Manager (uri, opts) {
* @api private
*/
Manager.prototype.emitAll = function () {
Manager.prototype.emitAll = function() {
this.emit.apply(this, arguments);
for (var nsp in this.nsps) {
if (has.call(this.nsps, nsp)) {
......@@ -90,7 +90,7 @@ Manager.prototype.emitAll = function () {
* @api private
*/
Manager.prototype.updateSocketIds = function () {
Manager.prototype.updateSocketIds = function() {
for (var nsp in this.nsps) {
if (has.call(this.nsps, nsp)) {
this.nsps[nsp].id = this.generateId(nsp);
......@@ -106,7 +106,7 @@ Manager.prototype.updateSocketIds = function () {
* @api private
*/
Manager.prototype.generateId = function (nsp) {
Manager.prototype.generateId = function(nsp) {
return (nsp === '/' ? '' : (nsp + '#')) + this.engine.id;
};
......@@ -124,7 +124,7 @@ Emitter(Manager.prototype);
* @api public
*/
Manager.prototype.reconnection = function (v) {
Manager.prototype.reconnection = function(v) {
if (!arguments.length) return this._reconnection;
this._reconnection = !!v;
return this;
......@@ -138,7 +138,7 @@ Manager.prototype.reconnection = function (v) {
* @api public
*/
Manager.prototype.reconnectionAttempts = function (v) {
Manager.prototype.reconnectionAttempts = function(v) {
if (!arguments.length) return this._reconnectionAttempts;
this._reconnectionAttempts = v;
return this;
......@@ -152,14 +152,14 @@ Manager.prototype.reconnectionAttempts = function (v) {
* @api public
*/
Manager.prototype.reconnectionDelay = function (v) {
Manager.prototype.reconnectionDelay = function(v) {
if (!arguments.length) return this._reconnectionDelay;
this._reconnectionDelay = v;
this.backoff && this.backoff.setMin(v);
return this;
};
Manager.prototype.randomizationFactor = function (v) {
Manager.prototype.randomizationFactor = function(v) {
if (!arguments.length) return this._randomizationFactor;
this._randomizationFactor = v;
this.backoff && this.backoff.setJitter(v);
......@@ -174,7 +174,7 @@ Manager.prototype.randomizationFactor = function (v) {
* @api public
*/
Manager.prototype.reconnectionDelayMax = function (v) {
Manager.prototype.reconnectionDelayMax = function(v) {
if (!arguments.length) return this._reconnectionDelayMax;
this._reconnectionDelayMax = v;
this.backoff && this.backoff.setMax(v);
......@@ -188,7 +188,7 @@ Manager.prototype.reconnectionDelayMax = function (v) {
* @api public
*/
Manager.prototype.timeout = function (v) {
Manager.prototype.timeout = function(v) {
if (!arguments.length) return this._timeout;
this._timeout = v;
return this;
......@@ -201,7 +201,7 @@ Manager.prototype.timeout = function (v) {
* @api private
*/
Manager.prototype.maybeReconnectOnOpen = function () {
Manager.prototype.maybeReconnectOnOpen = function() {
// Only try to reconnect if it's the first time we're connecting
if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {
// keeps reconnection from firing twice for the same reconnection loop
......@@ -218,7 +218,7 @@ Manager.prototype.maybeReconnectOnOpen = function () {
*/
Manager.prototype.open =
Manager.prototype.connect = function (fn, opts) {
Manager.prototype.connect = function(fn, opts) {
debug('readyState %s', this.readyState);
if (~this.readyState.indexOf('open')) return this;
......@@ -230,13 +230,13 @@ Manager.prototype.connect = function (fn, opts) {
this.skipReconnect = false;
// emit `open`
var openSub = on(socket, 'open', function () {
var openSub = on(socket, 'open', function() {
self.onopen();
fn && fn();
});
// emit `connect_error`
var errorSub = on(socket, 'error', function (data) {
var errorSub = on(socket, 'error', function(data) {
debug('connect_error');
self.cleanup();
self.readyState = 'closed';
......@@ -257,7 +257,7 @@ Manager.prototype.connect = function (fn, opts) {
debug('connect attempt will timeout after %d', timeout);
// set timer
var timer = setTimeout(function () {
var timer = setTimeout(function() {
debug('connect attempt timed out after %d', timeout);
openSub.destroy();
socket.close();
......@@ -266,7 +266,7 @@ Manager.prototype.connect = function (fn, opts) {
}, timeout);
this.subs.push({
destroy: function () {
destroy: function() {
clearTimeout(timer);
}
});
......@@ -284,7 +284,7 @@ Manager.prototype.connect = function (fn, opts) {
* @api private
*/
Manager.prototype.onopen = function () {
Manager.prototype.onopen = function() {
debug('open');
// clear old subs
......@@ -310,7 +310,7 @@ Manager.prototype.onopen = function () {
* @api private
*/
Manager.prototype.onping = function () {
Manager.prototype.onping = function() {
this.lastPing = new Date();
this.emitAll('ping');
};
......@@ -321,7 +321,7 @@ Manager.prototype.onping = function () {
* @api private
*/
Manager.prototype.onpong = function () {
Manager.prototype.onpong = function() {
this.emitAll('pong', new Date() - this.lastPing);
};
......@@ -331,7 +331,7 @@ Manager.prototype.onpong = function () {
* @api private
*/
Manager.prototype.ondata = function (data) {
Manager.prototype.ondata = function(data) {
this.decoder.add(data);
};
......@@ -341,7 +341,7 @@ Manager.prototype.ondata = function (data) {
* @api private
*/
Manager.prototype.ondecoded = function (packet) {
Manager.prototype.ondecoded = function(packet) {
this.emit('packet', packet);
};
......@@ -351,7 +351,7 @@ Manager.prototype.ondecoded = function (packet) {
* @api private
*/
Manager.prototype.onerror = function (err) {
Manager.prototype.onerror = function(err) {
debug('error', err);
this.emitAll('error', err);
};
......@@ -363,14 +363,14 @@ Manager.prototype.onerror = function (err) {
* @api public
*/
Manager.prototype.socket = function (nsp, opts) {
Manager.prototype.socket = function(nsp, opts) {
var socket = this.nsps[nsp];
if (!socket) {
socket = new Socket(this, nsp, opts);
this.nsps[nsp] = socket;
var self = this;
socket.on('connecting', onConnecting);
socket.on('connect', function () {
socket.on('connect', function() {
socket.id = self.generateId(nsp);
});
......@@ -395,7 +395,7 @@ Manager.prototype.socket = function (nsp, opts) {
* @param {Socket} socket
*/
Manager.prototype.destroy = function (socket) {
Manager.prototype.destroy = function(socket) {
var index = indexOf(this.connecting, socket);
if (~index) this.connecting.splice(index, 1);
if (this.connecting.length) return;
......@@ -410,7 +410,7 @@ Manager.prototype.destroy = function (socket) {
* @api private
*/
Manager.prototype.packet = function (packet) {
Manager.prototype.packet = function(packet) {
debug('writing packet %j', packet);
var self = this;
if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;
......@@ -418,7 +418,7 @@ Manager.prototype.packet = function (packet) {
if (!self.encoding) {
// encode, then write to engine with result
self.encoding = true;
this.encoder.encode(packet, function (encodedPackets) {
this.encoder.encode(packet, function(encodedPackets) {
for (var i = 0; i < encodedPackets.length; i++) {
self.engine.write(encodedPackets[i], packet.options);
}
......@@ -437,7 +437,7 @@ Manager.prototype.packet = function (packet) {
* @api private
*/
Manager.prototype.processPacketQueue = function () {
Manager.prototype.processPacketQueue = function() {
if (this.packetBuffer.length > 0 && !this.encoding) {
var pack = this.packetBuffer.shift();
this.packet(pack);
......@@ -450,7 +450,7 @@ Manager.prototype.processPacketQueue = function () {
* @api private
*/
Manager.prototype.cleanup = function () {
Manager.prototype.cleanup = function() {
debug('cleanup');
var subsLength = this.subs.length;
......@@ -473,7 +473,7 @@ Manager.prototype.cleanup = function () {
*/
Manager.prototype.close =
Manager.prototype.disconnect = function () {
Manager.prototype.disconnect = function() {
debug('disconnect');
this.skipReconnect = true;
this.reconnecting = false;
......@@ -493,7 +493,7 @@ Manager.prototype.disconnect = function () {
* @api private
*/
Manager.prototype.onclose = function (reason) {
Manager.prototype.onclose = function(reason) {
debug('onclose');
this.cleanup();
......@@ -512,7 +512,7 @@ Manager.prototype.onclose = function (reason) {
* @api private
*/
Manager.prototype.reconnect = function () {
Manager.prototype.reconnect = function() {
if (this.reconnecting || this.skipReconnect) return this;
var self = this;
......@@ -527,7 +527,7 @@ Manager.prototype.reconnect = function () {
debug('will wait %dms before reconnect attempt', delay);
this.reconnecting = true;
var timer = setTimeout(function () {
var timer = setTimeout(function() {
if (self.skipReconnect) return;
debug('attempting reconnect');
......@@ -537,7 +537,7 @@ Manager.prototype.reconnect = function () {
// check again for the case socket closed in above events
if (self.skipReconnect) return;
self.open(function (err) {
self.open(function(err) {
if (err) {
debug('reconnect attempt error');
self.reconnecting = false;
......@@ -551,7 +551,7 @@ Manager.prototype.reconnect = function () {
}, delay);
this.subs.push({
destroy: function () {
destroy: function() {
clearTimeout(timer);
}
});
......@@ -564,7 +564,7 @@ Manager.prototype.reconnect = function () {
* @api private
*/
Manager.prototype.onreconnect = function () {
Manager.prototype.onreconnect = function() {
var attempt = this.backoff.attempts;
this.reconnecting = false;
this.backoff.reset();
......
......@@ -14,10 +14,10 @@ module.exports = on;
* @api public
*/
function on (obj, ev, fn) {
function on(obj, ev, fn) {
obj.on(ev, fn);
return {
destroy: function () {
destroy: function() {
obj.removeListener(ev, fn);
}
};
......
......@@ -53,7 +53,7 @@ var emit = Emitter.prototype.emit;
* @api public
*/
function Socket (io, nsp, opts) {
function Socket(io, nsp, opts) {
this.io = io;
this.nsp = nsp;
this.json = this; // compat
......@@ -82,7 +82,7 @@ Emitter(Socket.prototype);
* @api private
*/
Socket.prototype.subEvents = function () {
Socket.prototype.subEvents = function() {
if (this.subs) return;
var io = this.io;
......@@ -100,7 +100,7 @@ Socket.prototype.subEvents = function () {
*/
Socket.prototype.open =
Socket.prototype.connect = function () {
Socket.prototype.connect = function() {
if (this.connected) return this;
this.subEvents();
......@@ -117,7 +117,7 @@ Socket.prototype.connect = function () {
* @api public
*/
Socket.prototype.send = function () {
Socket.prototype.send = function() {
var args = toArray(arguments);
args.unshift('message');
this.emit.apply(this, args);
......@@ -133,7 +133,7 @@ Socket.prototype.send = function () {
* @api public
*/
Socket.prototype.emit = function (ev) {
Socket.prototype.emit = function(ev) {
if (events.hasOwnProperty(ev)) {
emit.apply(this, arguments);
return this;
......@@ -173,7 +173,7 @@ Socket.prototype.emit = function (ev) {
* @api private
*/
Socket.prototype.packet = function (packet) {
Socket.prototype.packet = function(packet) {
packet.nsp = this.nsp;
this.io.packet(packet);
};
......@@ -184,7 +184,7 @@ Socket.prototype.packet = function (packet) {
* @api private
*/
Socket.prototype.onopen = function () {
Socket.prototype.onopen = function() {
debug('transport is open - connecting');
// write connect packet if necessary
......@@ -206,7 +206,7 @@ Socket.prototype.onopen = function () {
* @api private
*/
Socket.prototype.onclose = function (reason) {
Socket.prototype.onclose = function(reason) {
debug('close (%s)', reason);
this.connected = false;
this.disconnected = true;
......@@ -221,7 +221,7 @@ Socket.prototype.onclose = function (reason) {
* @api private
*/
Socket.prototype.onpacket = function (packet) {
Socket.prototype.onpacket = function(packet) {
var sameNamespace = packet.nsp === this.nsp;
var rootNamespaceError = packet.type === parser.ERROR && packet.nsp === '/';
......@@ -265,7 +265,7 @@ Socket.prototype.onpacket = function (packet) {
* @api private
*/
Socket.prototype.onevent = function (packet) {
Socket.prototype.onevent = function(packet) {
var args = packet.data || [];
debug('emitting event %j', args);
......@@ -287,7 +287,7 @@ Socket.prototype.onevent = function (packet) {
* @api private
*/
Socket.prototype.ack = function (id) {
Socket.prototype.ack = function(id) {
var self = this;
var sent = false;
return function () {
......@@ -312,7 +312,7 @@ Socket.prototype.ack = function (id) {
* @api private
*/
Socket.prototype.onack = function (packet) {
Socket.prototype.onack = function(packet) {
var ack = this.acks[packet.id];
if ('function' === typeof ack) {
debug('calling ack %s with %j', packet.id, packet.data);
......@@ -329,7 +329,7 @@ Socket.prototype.onack = function (packet) {
* @api private
*/
Socket.prototype.onconnect = function () {
Socket.prototype.onconnect = function() {
this.connected = true;
this.disconnected = false;
this.emit('connect');
......@@ -342,7 +342,7 @@ Socket.prototype.onconnect = function () {
* @api private
*/
Socket.prototype.emitBuffered = function () {
Socket.prototype.emitBuffered = function() {
var i;
for (i = 0; i < this.receiveBuffer.length; i++) {
emit.apply(this, this.receiveBuffer[i]);
......@@ -361,7 +361,7 @@ Socket.prototype.emitBuffered = function () {
* @api private
*/
Socket.prototype.ondisconnect = function () {
Socket.prototype.ondisconnect = function() {
debug('server disconnect (%s)', this.nsp);
this.destroy();
this.onclose('io server disconnect');
......@@ -375,7 +375,7 @@ Socket.prototype.ondisconnect = function () {
* @api private.
*/
Socket.prototype.destroy = function () {
Socket.prototype.destroy = function() {
if (this.subs) {
// clean subscriptions to avoid reconnections
for (var i = 0; i < this.subs.length; i++) {
......@@ -395,7 +395,7 @@ Socket.prototype.destroy = function () {
*/
Socket.prototype.close =
Socket.prototype.disconnect = function () {
Socket.prototype.disconnect = function() {
if (this.connected) {
debug('performing disconnect (%s)', this.nsp);
this.packet({ type: parser.DISCONNECT });
......@@ -419,7 +419,7 @@ Socket.prototype.disconnect = function () {
* @api public
*/
Socket.prototype.compress = function (compress) {
Socket.prototype.compress = function(compress) {
this.flags.compress = compress;
return this;
};
......@@ -432,7 +432,7 @@ Socket.prototype.compress = function (compress) {
* @api public
*/
Socket.prototype.binary = function (binary) {
Socket.prototype.binary = function(binary) {
this.flags.binary = binary;
return this;
};
......@@ -89,7 +89,7 @@ android {
armv7 {
versionCode defaultConfig.versionCode
ndk {
abiFilters "armeabi-v7a", ""
abiFilters "armeabi-v7a", "x86", ""
}
}
......@@ -124,7 +124,7 @@ android {
armv7 {
versionCode defaultConfig.versionCode
ndk {
abiFilters "armeabi-v7a", ""
abiFilters "armeabi-v7a", "x86", ""
}
}
armv8 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment