Closed Bug 1532967 Opened 5 years ago Closed 5 years ago

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

Categories

(Thunderbird :: Instant Messaging, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 67.0

People

(Reporter: KaiE, Assigned: mkmelin)

References

Details

(Keywords: regression)

Attachments

(1 file)

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]);

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?

Blocks: 1518172

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

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

Attachment #9050918 - Flags: review?(kaie)
Status: NEW → ASSIGNED
Comment on attachment 9050918 [details] [diff] [review]
bug1532967_chat_appendNotification.patch

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

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: 5 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 67.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: