diff --git a/rocketchat.cpp b/rocketchat.cpp
index 918ce0fef4c4f38ac3ff6364279f56ca3187f3f8..d6f504e5ba3314e1013867e1600f3b0b39925fb5 100755
--- a/rocketchat.cpp
+++ b/rocketchat.cpp
@@ -91,6 +91,10 @@ void RocketChat::joinChannel( const QString &pServerId, const QString &pChannelI
     if ( mServerStatus ) {
 
         QMetaObject::invokeMethod( mServerMap.first(),  "joinChannel", Q_ARG( QString, pChannelId ) );
+
+        if ( !mFileToShare.isEmpty() ) {
+            uploadSharedFileToChannel( pChannelId );
+        }
     }
 }
 
@@ -439,6 +443,7 @@ void RocketChat::uploadSharedFileToChannel( const QString &pChannelId )
 {
     if ( mServerStatus ) {
         QMetaObject::invokeMethod( mServerMap.first(),  "uploadFile", Q_ARG( QString, pChannelId ), Q_ARG( QString, mFileToShare ) );
+        mFileToShare.clear();
     }
 }
 
@@ -636,11 +641,7 @@ void RocketChat::resetLoginMethods()
 
 void RocketChat::openIosFile( const QString &fileName )
 {
-    //QFile file(fileName);
-
     mFileToShare = fileName;
-    qDebug() << "share file received...";
-    emit openShareDialog();
 }
 
 void RocketChat::openUrl( const QString url )
@@ -737,7 +738,6 @@ void RocketChat::serverReadySlot()
 
     connect( pServer, &RocketChatServerData::openUrl, this, &RocketChat::openUrl, Qt::UniqueConnection );
 
-    connect( pServer, &RocketChatServerData::allChannelsReady, this, &RocketChat::onAllChannelsReceived, Qt::UniqueConnection );
     connect( pServer, &RocketChatServerData::usersReady, this, &RocketChat::channelUsersReady, Qt::UniqueConnection );
     connect( pServer, &RocketChatServerData::channelDetailsReady, this, &RocketChat::channelDetailsReady, Qt::UniqueConnection );
     connect( pServer, &RocketChatServerData::unreadCountChanged, this, &RocketChat::onUnreadCountChanged, Qt::UniqueConnection );
@@ -819,12 +819,6 @@ void RocketChat::onEmojisReady( const QVariantList &pEmojiList )
     emit emojisReady( pEmojiList );
 }
 
-//used only for share Dialog
-void RocketChat::onAllChannelsReceived( const QVariantList &pChannels )
-{
-    emit allChannelsReceived( pChannels );
-}
-
 void RocketChat::onServerSlotsReady()
 {
 #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)