TB chat: buddy-authorization-request broken, "box.appendNotification is not a function"

RESOLVED FIXED in Thunderbird 67.0

Status

defect
RESOLVED FIXED
4 months ago
4 months ago

People

(Reporter: kaie, Assigned: mkmelin)

Tracking

(Blocks 1 bug, {regression})

Trunk
Thunderbird 67.0
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Reporter

Description

4 months ago

Seen with current comm-central trunk.

Incoming buddy auth requests are broken.
No UI is shown.

Console has this error:
TypeError: box.appendNotification is not a function chat-messenger.js:1043:11
observe chrome://messenger/content/chat/chat-messenger.js:1043
addBuddyRequest resource:///modules/jsProtoHelper.jsm:166
onPresenceStanza resource:///modules/xmpp.jsm:1795
accountListening resource:///modules/xmpp-session.jsm:667
endElement resource:///modules/xmpp-xml.jsm:425
onDataAvailable resource:///modules/xmpp-xml.jsm:354
onDataReceived resource:///modules/xmpp-session.jsm:313
_handleQueue resource:///modules/socket.jsm:423
_handleQueue self-hosted:995

Ignore line numbers, I have local changes in chat-messenger.js

I hope this isn't related to the changes I'm porting? Can you confirm this bug?

if (aTopic == "buddy-authorization-request") {
  aSubject.QueryInterface(Ci.prplIBuddyRequest);
  let bundle = document.getElementById("chatBundle");
  let label = bundle.getFormattedString("buddy.authRequest.label",
                                        [aSubject.userName]);
  let value =
    "buddy-auth-request-" + aSubject.account.id + aSubject.userName;
  let acceptButton = {
    accessKey: bundle.getString("buddy.authRequest.allow.accesskey"),
    label: bundle.getString("buddy.authRequest.allow.label"),
    callback() { aSubject.grant(); },
  };
  let denyButton = {
    accessKey: bundle.getString("buddy.authRequest.deny.accesskey"),
    label: bundle.getString("buddy.authRequest.deny.label"),
    callback() { aSubject.deny(); },
  };
  let box = document.getElementById("chatTabPanel");

-> box.appendNotification(label, value, null, box.PRIORITY_INFO_HIGH,
[acceptButton, denyButton]);

Assignee

Comment 1

4 months ago

This is due to the notification box de-xbl they did in core a while back. We have the old xbl-notification forked in common/ - but nobody yet hooked chat up to use that. So chat is currently missing some notifications.

Keywords: regression
Component: General → Instant Messaging
Product: Chat Core → Thunderbird
Version: trunk → Trunk

Magnus, do you know what's necessary to hook the chat code up to use the forked code?

Reporter

Updated

4 months ago
Blocks: 1518172
Assignee

Comment 3

4 months ago

Actually, I was likely wrong about that, the forked binding should be hooked up.

I think the problem is that we have two elements with the same id="chatTabPanel"
... and it's getting the wrong one now. Blame doesn't easily show me where this got messed up. Possibly already in the overlay changes a year ago

https://searchfox.org/comm-central/search?q=chatTabPanel&path=

Assignee: nobody → mkmelin+mozilla
Assignee

Comment 4

4 months ago

I'm not sure there's an easy way to trigger these notifications. Does this fix it for you?

Attachment #9050918 - Flags: review?(kaie)
Assignee

Updated

4 months ago
Status: NEW → ASSIGNED
Reporter

Comment 5

4 months ago
Comment on attachment 9050918 [details] [diff] [review]
bug1532967_chat_appendNotification.patch

Yes, works great, thanks a lot!
Attachment #9050918 - Flags: review?(kaie) → review+
Reporter

Updated

4 months ago
Keywords: checkin-needed

Comment 6

4 months ago

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/0926693124ee
fix chat "box.appendNotification is not a function". r=kaie

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Keywords: checkin-needed
Resolution: --- → FIXED

Updated

4 months ago
Target Milestone: --- → Thunderbird 67.0
You need to log in before you can comment on or make changes to this bug.