Help
Ask questions about how to do or fix things in Arrowchat
User avatar
lmbuffetti
Customer
 
Posts: 2
Joined: 19 Feb 2016, 08:02

 

by lmbuffetti 19 Feb 2016, 08:10

Hi,

I have a problem with arrowchat, version 1.8.3. I'm a web developer and I have a client that use the arrowchat on site developed with Wordpress, I didn't developed it. Now I should fix some problem of this site but I don't know how I can fix the following problem.

The chat works very well on desktop but on mobile when a user click on button to chat with other user on the console I have this error: jqac.arrowchat.chatWith is not a function. (In 'jqac.arrowchat.chatWith('205')', 'jqac.arrowchat.chatWith' is undefined).

The button to chat with user is: <a href="javascript:;" onclick="jqac.arrowchat.chatWith('205');" class="chat button">Chatta con me</a> where the 205 is the id of user.

How can I fix this problem?

Thanks
User avatar
jcom
Customer
 
Posts: 25
Joined: 27 Apr 2016, 01:19

 

by jcom 02 May 2016, 01:21

having the same problem

cannot work on mobile
User avatar
jensrenner1980
Customer
 
Posts: 6
Joined: 02 May 2016, 10:28

 

by jensrenner1980 02 May 2016, 16:51

Same problem for me, tested with 1.8.3 and 1.8.42.
The tab does not open when using Chrome on Android, but as soon as I enable "request desktop version" in mobile Chrome everything works as expected.
User avatar
jensrenner1980
Customer
 
Posts: 6
Joined: 02 May 2016, 10:28

 

by jensrenner1980 02 May 2016, 17:54

Could it be related to "arguments.callee" being deprecated, and the mobile Chrome browser not supporting it because it runs in a "light" or "strict" mode?
User avatar
jcom
Customer
 
Posts: 25
Joined: 27 Apr 2016, 01:19

 

by jcom 03 May 2016, 00:36

We need some solutions for that, please support... If not it's useless in mobile devices.
User avatar
jensrenner1980
Customer
 
Posts: 6
Joined: 02 May 2016, 10:28

 

by jensrenner1980 03 May 2016, 09:15

I've just set up a test case to reproduce the issue. I am using AC 1.8.42, a fresh install and a users table with 1: admin 2: test.
My page looks like this:
Code: Select all
<html>
<head>
<link type="text/css" rel="stylesheet" id="arrowchat_css" media="all" href="/arrowchat/external.php?type=css" charset="utf-8" />
<script type="text/javascript" src="/arrowchat/includes/js/jquery.js"></script>
<script type="text/javascript" src="/arrowchat/includes/js/jquery-ui.js"></script>
</head>
<body>
<a href="#" onclick="javascript:jqac.arrowchat.chatWith('1');">1</a>
<a href="#" onclick="javascript:jqac.arrowchat.chatWith('2');">2</a>
<script type="text/javascript" src="/arrowchat/external.php?type=djs" charset="utf-8"></script>
<script type="text/javascript" src="/arrowchat/external.php?type=js" charset="utf-8"></script>
</body>
</html>


This works with Chrome on both my desktop and mobile device, also with my desktop Chrome set to mobile emulation.
But as soon as enable "Chat Tab on Mobile Devices", it stops working on my smartphone and also in the emulation. The error I am getting is: "Uncaught TypeError: jqac.arrowchat.chatWith is not a function"

Maybe that helps. I wonder why the issue doesn't appear when "Chat Tab on Mobile Devices" is disabled.
User avatar
Jason
Customer
 
Posts: 2356
Joined: 12 Dec 2009, 16:06

 

by Jason 03 May 2016, 12:13

The chatWith API will not work on mobile. We will be fixing this in the next update.
User avatar
jensrenner1980
Customer
 
Posts: 6
Joined: 02 May 2016, 10:28

 

by jensrenner1980 03 May 2016, 13:28

I developed a somewhat ugly hack that fixes this behaviour. You need to change 3 files.

In includes/js/arrowchat_mobile.js at line 309 (after arguments.callee.runarrowchat = runarrowchat;) add:
Code: Select all
                arguments.callee.chatWith = function (b) {
                        window.open(c_ac_path + 'public/mobile/?id='+b, 'mobiletab', '_blank');
                };
 


In public/mobile/includes/js/mobile_core.js at line 156 (before arguments.callee.videoWith=function(b){) add:
Code: Select all
arguments.callee.chatWith = function (b) {
        Oa(b);
};


In public/mobile/index.php at line 43 change <body> to
Code: Select all
<body <?php if (!empty($_GET['id'])) echo("onload=\"jqac.arrowchat.chatWith('".$_GET['id']."')\""); ?>>


It's far from perfect, but at least it opens the mobile tab and shows the user to chat with.
User avatar
jcom
Customer
 
Posts: 25
Joined: 27 Apr 2016, 01:19

 

by jcom 06 May 2016, 01:29

Much appreciated @JRenner22

the problem I have is that when opening the chat It shows the list of users and not opens the chatroom with the userid.. But that user appears at the bottom of the list, and when clicking over it it displays another username.

You face the same problem here?

Best!
User avatar
jensrenner1980
Customer
 
Posts: 6
Joined: 02 May 2016, 10:28

 

by jensrenner1980 06 May 2016, 09:11

You are right. Since the source code is a bit obfuscated, I can only guess what functions are meant to do.
So basically it's trial and error.
Please try to insert Xa(); before Oa(b); in public/mobile/includes/js/mobile_core.js
That seem's to fix it for me.
User avatar
jcom
Customer
 
Posts: 25
Joined: 27 Apr 2016, 01:19

 

by jcom 07 May 2016, 01:19

thanks again @JRenner22

I have it like you said but does the same, just opens the buddy list but not the actual chartoom with userid:

Code: Select all
arguments.callee.chatWith = function (b) {
    Xa();
    Oa(b);
};
User avatar
jensrenner1980
Customer
 
Posts: 6
Joined: 02 May 2016, 10:28

 

by jensrenner1980 08 May 2016, 23:24

jcom, that's true. Even though I tried a lot of things I didn't manage to scroll to the 2nd page where the actual conversation is shown.
It only fixes the issue of not showing the correct user when selecting the newly created conversation.
User avatar
jcom
Customer
 
Posts: 25
Joined: 27 Apr 2016, 01:19

 

by jcom 08 May 2016, 23:34

Well at least you managed that :) I'm using it appreciated.

hope the arrowchat team gets us the proper upate soon.
User avatar
WLeonardo
Customer
 
Posts: 3
Joined: 20 Jun 2016, 02:35

 

by WLeonardo 07 Jul 2016, 05:55

Hi.

solved the problem..wasn't sending messages from windows phone.

There is a missing argument in the "arrowchat\public\mobile\includes\js\mobile_libraries.js" file
Search for:"this.sound.removeEventListener("ended");"
and replce with "this.sound.removeEventListener("ended",this._ended.bind(this));"
Hope someone can use it!