Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* removing console.logs

* Sovling some notification message type
* Some other bugs resolution
  • Loading branch information...
commit 431fc6d7e078e7f648d3f72e3b3ed46e8106ad58 1 parent fe60864
Antoine Mercadal authored
View
2  AUTHORS
@@ -1,4 +1,4 @@
Antoine Mercadal <antoine.mercadal@inframonde.eu>
project owner
- developer
+ lead developer
View
4 Resources/Strophe/strophe.js
@@ -1503,8 +1503,8 @@ Strophe.Handler.prototype = {
e.line + " - " + e.name + ": " + e.message);
} else if (e.fileName) {
if (typeof(console) != "undefined") {
- console.trace();
- console.error(this.handler, " - error - ", e, e.message);
+ //console.trace();
+ //console.error(this.handler, " - error - ", e, e.message);
}
Strophe.fatal("error: " + this.handler + " " +
e.fileName + ":" + e.lineNumber + " - " +
View
93 TNStropheConnection.j
@@ -57,7 +57,7 @@ TNStropheConnectionStatusDisconnected = @"TNStropheConnectionStatusDisconnec
@group TNStropheConnectionDebug
If set to true, all stanza received are written in the console.
*/
-TNStropheConnectionDebugModeIsEnabled = NO;
+TNStropheConnectionDebugModeIsEnabled = YES;
/*! @ingroup strophecappuccino
@@ -201,57 +201,50 @@ TNStropheConnectionDebugModeIsEnabled = NO;
*/
- (void)connect
-{
- try
+{
+ _connection = new Strophe.Connection(_boshService);
+ _connection.connect([self jid] + @"/controller", [self password], function (status, errorCond)
{
- _connection = new Strophe.Connection(_boshService);
- _connection.connect([self jid] + @"/controller", [self password], function (status, errorCond)
+ var center = [CPNotificationCenter defaultCenter];
+
+ if (status == Strophe.Status.CONNECTING)
{
- var center = [CPNotificationCenter defaultCenter];
-
- if (status == Strophe.Status.CONNECTING)
- {
- if ([[self delegate] respondsToSelector:@selector(onStropheConnecting:)])
- [[self delegate] onStropheConnecting:self];
-
- [center postNotification:TNStropheConnectionStatusConnecting];
- }
- else if (status == Strophe.Status.CONNFAIL)
- {
- if ([[self delegate] respondsToSelector:@selector(onStropheConnectFail:)])
- [[self delegate] onStropheConnectFail:self];
-
- [center postNotification:TNStropheConnectionStatusFailure];
- }
- else if (status == Strophe.Status.DISCONNECTING)
- {
- if ([[self delegate] respondsToSelector:@selector(onStropheDisconnecting:)])
- [[self delegate] onStropheDisconnecting:self];
-
- [center postNotification:TNStropheConnectionStatusDisconnecting];
- }
- else if (status == Strophe.Status.DISCONNECTED)
- {
- if ([[self delegate] respondsToSelector:@selector(onStropheDisconnected:)])
- [[self delegate] onStropheDisconnected:self];
-
- [center postNotification:TNStropheConnectionStatusDisconnected];
- }
- else if (status == Strophe.Status.CONNECTED)
- {
- _connection.send($pres().tree());
-
- if ([[self delegate] respondsToSelector:@selector(onStropheConnected:)])
- [[self delegate] onStropheConnected:self];
-
- [center postNotification:TNStropheConnectionStatusConnected object:self];
- }
- }, /* wait */ 3600);
- }
- catch(ex)
- {
- alert(ex);
- }
+ if ([[self delegate] respondsToSelector:@selector(onStropheConnecting:)])
+ [[self delegate] onStropheConnecting:self];
+
+ [center postNotificationName:TNStropheConnectionStatusConnecting object:self];
+ }
+ else if (status == Strophe.Status.CONNFAIL)
+ {
+ if ([[self delegate] respondsToSelector:@selector(onStropheConnectFail:)])
+ [[self delegate] onStropheConnectFail:self];
+
+ [center postNotificationName:TNStropheConnectionStatusFailure object:self];
+ }
+ else if (status == Strophe.Status.DISCONNECTING)
+ {
+ if ([[self delegate] respondsToSelector:@selector(onStropheDisconnecting:)])
+ [[self delegate] onStropheDisconnecting:self];
+
+ [center postNotificationName:TNStropheConnectionStatusDisconnecting object:self];
+ }
+ else if (status == Strophe.Status.DISCONNECTED)
+ {
+ if ([[self delegate] respondsToSelector:@selector(onStropheDisconnected:)])
+ [[self delegate] onStropheDisconnected:self];
+
+ [center postNotificationName:TNStropheConnectionStatusDisconnected object:self];
+ }
+ else if (status == Strophe.Status.CONNECTED)
+ {
+ _connection.send($pres().tree());
+
+ if ([[self delegate] respondsToSelector:@selector(onStropheConnected:)])
+ [[self delegate] onStropheConnected:self];
+
+ [center postNotificationName:TNStropheConnectionStatusConnected object:self];
+ }
+ }, /* wait */ 3600);
}
/*! this disconnect the XMPP connection
View
8 TNStropheStanza.j
@@ -285,6 +285,14 @@
return [[TNStropheStanza alloc] initWithNode:aStanza];
}
+/*! get the from node only field of the stanza
+ @return from node field of stanza
+*/
+- (CPString)getFromNode
+{
+ return [self valueForAttribute:@"from"].split("/")[0];
+}
+
/*! get the from field of the stanza
@return from field of stanza
*/
Please sign in to comment.
Something went wrong with that request. Please try again.