Skip to content

Commit

Permalink
Move room signal handler init to the constructor
Browse files Browse the repository at this point in the history
Since we already have QMatrixClient::Room *m_room initialization at the
constructor
  • Loading branch information
a-andreyev committed Dec 6, 2018
1 parent 4d41a98 commit 830936c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/messageschannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ MatrixMessagesChannel::MatrixMessagesChannel(MatrixConnection *connection, QMatr
/* creationTimestamp */ QDateTime());
baseChannel->plugInterface(Tp::AbstractChannelInterfacePtr::dynamicCast(m_roomIface));
}

connect(m_room, &QMatrixClient::Room::pendingEventChanged, this, &MatrixMessagesChannel::onPendingEventChanged);
}

void MatrixMessagesChannel::onPendingEventChanged(int pendingEventIndex)
Expand Down Expand Up @@ -140,7 +142,6 @@ QString MatrixMessagesChannel::sendMessageCallback(const Tp::MessagePartList &me
}
}

connect(m_room, &QMatrixClient::Room::pendingEventChanged, this, &MatrixMessagesChannel::onPendingEventChanged);
QString txnId = m_room->postPlainText(content);
return txnId;
}
Expand Down

0 comments on commit 830936c

Please sign in to comment.