Skip to content

Commit

Permalink
Fix display of channel_invite push notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Oct 28, 2015
1 parent 7da442f commit 754aa7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/com/irccloud/android/GCMService.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public void onMessageReceived(String id, Bundle data) {

String from = data.getString("from_nick");
String msg = data.getString("msg");
if(type.equals("channel_invite"))
msg = "Invitation to join " + data.getString("channel");
if (msg != null)
msg = ColorFormatter.html_to_spanned(ColorFormatter.irc_to_html(TextUtils.htmlEncode(msg))).toString();
String chan = data.getString("chan");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,15 @@ private void showOtherNotifications() {
for (Notification n : notifications) {
if (!n.shown) {
if (n.message_type.equals("callerid")) {
title = "Callerid: " + n.nick + " (" + n.network + ")";
text = n.nick + " " + n.message;
title = n.nick;
text = "Callerid: " + n.nick + " " + n.message;
ticker = n.nick + " " + n.message;
} else {
title = n.nick + " (" + n.network + ")";
title = n.nick;
text = n.message;
ticker = n.message;
}
NotificationManagerCompat.from(IRCCloudApplication.getInstance().getApplicationContext()).notify((int) (n.eid / 1000), buildNotification(ticker, n.bid, new long[]{n.eid}, title, text, Html.fromHtml(text), 1, null, null, title, null));
NotificationManagerCompat.from(IRCCloudApplication.getInstance().getApplicationContext()).notify((int) (n.eid / 1000), buildNotification(ticker, n.bid, new long[]{n.eid}, title, text, Html.fromHtml(text), 1, null, null, n.network, null));
n.shown = true;
}
}
Expand Down

0 comments on commit 754aa7d

Please sign in to comment.